mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42574 from sbojarski/boto-cfn-error-reporting
Fixed error reporting in "boto_cfn.present" function.
This commit is contained in:
commit
f2b0c9b4fa
1 changed files with 6 additions and 2 deletions
|
@ -141,10 +141,14 @@ def present(name, template_body=None, template_url=None, parameters=None, notifi
|
|||
stack_policy_body = _get_template(stack_policy_body, name)
|
||||
stack_policy_during_update_body = _get_template(stack_policy_during_update_body, name)
|
||||
|
||||
for i in [template_body, stack_policy_body, stack_policy_during_update_body]:
|
||||
if isinstance(i, dict):
|
||||
return i
|
||||
|
||||
_valid = _validate(template_body, template_url, region, key, keyid, profile)
|
||||
log.debug('Validate is : {0}.'.format(_valid))
|
||||
if _valid is not True:
|
||||
code, message = _get_error(_valid)
|
||||
code, message = _valid
|
||||
ret['result'] = False
|
||||
ret['comment'] = 'Template could not be validated.\n{0} \n{1}'.format(code, message)
|
||||
return ret
|
||||
|
@ -250,7 +254,7 @@ def _get_template(template, name):
|
|||
def _validate(template_body=None, template_url=None, region=None, key=None, keyid=None, profile=None):
|
||||
# Validates template. returns true if template syntax is correct.
|
||||
validate = __salt__['boto_cfn.validate_template'](template_body, template_url, region, key, keyid, profile)
|
||||
log.debug('Validate is result is {0}.'.format(str(validate)))
|
||||
log.debug('Validate result is {0}.'.format(str(validate)))
|
||||
if isinstance(validate, str):
|
||||
code, message = _get_error(validate)
|
||||
log.debug('Validate error is {0} and message is {1}.'.format(code, message))
|
||||
|
|
Loading…
Add table
Reference in a new issue