Giter Club home page Giter Club logo

deforest's People

Contributors

hawry avatar

Stargazers

 avatar  avatar  avatar

deforest's Issues

TypeError: __repr__ returned non-string (type list) when running deforest on CF template

Describe the bug
Running deforest on a CF template containing lists fails during debug logging.

Expected behavior
Do not fail the entire run if the logging calls don't work, especially for debug level logs.

Screenshots or error logs

$ deforest -d template.yml
DEBUG: parsing file 'template.yml'
DEBUG: read 33678 bytes from file
DEBUG: received 33678 bytes of data to clean
DEBUG: enabling CF tags
DEBUG: parsing yaml
DEBUG: creating cleaner queue
DEBUG: created queue with size 0
DEBUG: created <deforest.cleaners.CloudFormationCleaner instance at 0x7f08bc323638>
DEBUG: created <deforest.cleaners.DefaultCleaner instance at 0x7f08bc32dbd8>
DEBUG: created <deforest.cleaners.IgnoreCleaner instance at 0x7f08bc32dc20>
DEBUG: <deforest.cleaners.CloudFormationCleaner instance at 0x7f08bc323638> clean
Traceback (most recent call last):
  File "/home/hawry/.local/bin/deforest", line 11, in <module>
    sys.exit(main())
  File "/home/hawry/.local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/hawry/.local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/hawry/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hawry/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/hawry/.local/lib/python2.7/site-packages/deforest/deforest.py", line 26, in main
    cleaned = f.clean()
  File "/home/hawry/.local/lib/python2.7/site-packages/deforest/filecleaner.py", line 48, in clean
    self.cleaner_queue.get().clean()
  File "/home/hawry/.local/lib/python2.7/site-packages/deforest/cleaners.py", line 18, in clean
    logging.debug("checking {}".format(self.caller.result))
TypeError: __repr__ returned non-string (type list)

Desktop (please complete the following information):
WSL on Win 10

OAS/Swagger version:
OAS 3

Additional context
CloudFormation template version 2010-09-09

ConstructorError: could not determine a constructor for the tag '!Equals'

Describe the bug
Running deforest on CF containing non-supported shorthand AWS functions fails.

Expected behavior
Ignore unknown AWS functions and continue with the export.

Screenshots or error logs

yaml.constructor.ConstructorError: could not determine a constructor for the tag '!Equals'
  in "<string>", line 38, column 21:
      ConditonalLogicalId: !Equals  #If site equals  ...

Desktop (please complete the following information):
WSL on Win 10

OAS/Swagger version:
OAS 3

Additional context
CloudFormation versino 2010-09-09

Fix output order

The current order in the output file is quite random, this should probably follow at least a more logical order than "first come first serve"

TypeError: main() got an unexpected keyword argument 'format'

Describe the bug

Traceback (most recent call last):
  File "/home/x/.local/bin/deforest", line 11, in <module>
    sys.exit(main())
  File "/home/x/.local/lib/python3.8/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/x/.local/lib/python3.8/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/x/.local/lib/python3.8/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/x/.local/lib/python3.8/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
TypeError: main() got an unexpected keyword argument 'format'

Expected behavior
A cleaned template returned

OAS/Swagger version:

  • OAS 3

Additional context
Option variable has the wrong name in the @click.option part vs the method call

Handle AWS::Serverless::Api in CF template as well

Describe the solution you'd like
Handle resources with the type AWS::Serverless::Api in the same way as AWS::ApiGateway::RestApi.

Additional context
If specified, the body is located under each resource #/Properties/DefinitionBody

Make deforest importable

Deforest should be importable by other modules to enable use in automated tasks and custom build pipes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.