diff --git a/util/upload-cfn-templates.py b/util/upload-cfn-templates.py index f50b499c6a..81cfacd137 100644 --- a/util/upload-cfn-templates.py +++ b/util/upload-cfn-templates.py @@ -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