Put in trap for args being None

_normalize_old_style_args can return None. If it does, the loop
"for args in args" blows up.
This commit is contained in:
Monty Taylor 2015-11-28 13:37:40 -05:00 committed by James Cammarata
parent 737e467b8a
commit 73a269f9a5

View file

@ -157,7 +157,7 @@ class ModuleArgsParser:
# only internal variables can start with an underscore, so # only internal variables can start with an underscore, so
# we don't allow users to set them directy in arguments # we don't allow users to set them directy in arguments
if action not in ('command', 'shell', 'script', 'raw'): if args and action not in ('command', 'shell', 'script', 'raw'):
for arg in args: for arg in args:
if arg.startswith('_ansible_'): if arg.startswith('_ansible_'):
raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg)) raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg))