Merge pull request #3103 from shano/fix-invalid-yaml-parsererror

Cloudformation: Fix - validate template yml fixes
This commit is contained in:
Mike Grima 2020-07-04 12:28:17 -07:00 committed by GitHub
commit c1cffec674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View file

@ -365,8 +365,8 @@ class CloudFormationResponse(BaseResponse):
except (ValueError, KeyError):
pass
try:
description = yaml.load(template_body)["Description"]
except (yaml.ParserError, KeyError):
description = yaml.load(template_body, Loader=yaml.Loader)["Description"]
except (yaml.parser.ParserError, yaml.scanner.ScannerError, KeyError):
pass
template = self.response_template(VALIDATE_STACK_RESPONSE_TEMPLATE)
return template.render(description=description)