Skip to content

Commit d38e6fe

Browse files
lukeseawalkerdemartinofra
authored andcommitted
Fix template extension retrivial
Signed-off-by: Luca Carrogu <[email protected]>
1 parent 378e6a3 commit d38e6fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util/upload-cfn-templates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ 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 = file_name[len(template_name) :] # noqa: E203
35+
extension = os.path.splitext(file_name)[1]
3636
if extension not in {".cfn.json", ".cfn.yaml"}:
3737
raise Exception("Found invalid extension for template {}: {}".format(template_name, extension))
3838
return extension

0 commit comments

Comments
 (0)