Skip to content

Commit 01c827f

Browse files
committed
Fix template extension retrivial
Signed-off-by: Luca Carrogu <[email protected]>
1 parent d38e6fe commit 01c827f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

util/upload-cfn-templates.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def get_template_extension(templates_dir, template_name):
3232
"Found 0 or multiple matching files for template name {}: {}".format(template_name, matching_files)
3333
)
3434
file_name = os.path.basename(matching_files[0])
35-
extension = os.path.splitext(file_name)[1]
36-
if extension not in {".cfn.json", ".cfn.yaml"}:
35+
extension = file_name.split(".cfn.")[-1]
36+
if extension not in {"json", "yaml"}:
3737
raise Exception("Found invalid extension for template {}: {}".format(template_name, extension))
3838
return extension
3939

0 commit comments

Comments
 (0)