catches exception if conditional cannot be parsed (#5067)
If the conditional cannot be parsed, the module will now catch the exception and return a well formed failed message. fixes #5060
This commit is contained in:
parent
da4c11241f
commit
73cf85d677
1 changed files with 6 additions and 2 deletions
|
@ -263,8 +263,12 @@ def main():
|
||||||
exc = get_exception()
|
exc = get_exception()
|
||||||
warnings.append('duplicate command detected: %s' % cmd)
|
warnings.append('duplicate command detected: %s' % cmd)
|
||||||
|
|
||||||
for item in conditionals:
|
try:
|
||||||
runner.add_conditional(item)
|
for item in conditionals:
|
||||||
|
runner.add_conditional(item)
|
||||||
|
except (ValueError, AttributeError):
|
||||||
|
exc = get_exception()
|
||||||
|
module.fail_json(msg=str(exc))
|
||||||
|
|
||||||
runner.retries = module.params['retries']
|
runner.retries = module.params['retries']
|
||||||
runner.interval = module.params['interval']
|
runner.interval = module.params['interval']
|
||||||
|
|
Loading…
Reference in a new issue