Skip to content

Commit

Permalink
Fix template extension retrivial
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Carrogu <[email protected]>
  • Loading branch information
lukeseawalker committed Sep 11, 2020
1 parent d38e6fe commit 01c827f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/upload-cfn-templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def get_template_extension(templates_dir, template_name):
"Found 0 or multiple matching files for template name {}: {}".format(template_name, matching_files)
)
file_name = os.path.basename(matching_files[0])
extension = os.path.splitext(file_name)[1]
if extension not in {".cfn.json", ".cfn.yaml"}:
extension = file_name.split(".cfn.")[-1]
if extension not in {"json", "yaml"}:
raise Exception("Found invalid extension for template {}: {}".format(template_name, extension))
return extension

Expand Down

0 comments on commit 01c827f

Please sign in to comment.