Cloudformation: Fix - validate template yml fixes
This change fixes: * Replace call to non-existent exception yaml.ParserError * Catches yaml scanner error for valid json with tabs * Supply yaml loader to ensure yaml loading throws exception validly for json with tabs and doesn't try to load the json incorrectly
This commit is contained in:
parent
73813460b6
commit
0f062f68ff
2 changed files with 21 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue