1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Provide message instead of backtrace on bad operator (#21851)

Fixes #21847
This commit is contained in:
Nathaniel Case 2017-03-01 12:01:35 -05:00 committed by GitHub
parent 49194a66c8
commit b8f4b1f951

View file

@ -134,6 +134,7 @@ warnings:
import time
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.pycompat24 import get_exception
from ansible.module_utils.netcli import Conditional
from ansible.module_utils.network_common import ComplexList
from ansible.module_utils.six import string_types
@ -185,7 +186,11 @@ def main():
commands = parse_commands(module, warnings)
wait_for = module.params['wait_for'] or list()
conditionals = [Conditional(c) for c in wait_for]
try:
conditionals = [Conditional(c) for c in wait_for]
except AttributeError:
exc = get_exception()
module.fail_json(msg=str(exc))
retries = module.params['retries']
interval = module.params['interval']