brysontyrrell / Possum

A packaging tool for Python based AWS serverless applications.
MIT License
21 stars 2 forks source link

Create output yml file if it doesn't exist instead of raising FileNotFoundError #22

Open mam8cc opened 5 years ago

mam8cc commented 5 years ago

If you attempt to run possum with an output file that doesn't exist you get a FileNotFoundError.

$ possum 'my-deploy-bucket' -o deploy.yml                                                 
ERROR: Failed to load template file! Encountered: FileNotFoundError

Open the file in the w+ mode to create the missing file.

mam8cc commented 5 years ago

I also removed the t in the mode string because it is the default in 2.7 and 3.* as far as I can tell.

https://docs.python.org/3/library/functions.html#open