More restrictive test against variable name to allow setting variable starting with _.

This commit is contained in:
Yannig Perré 2015-11-28 10:30:42 +01:00 committed by James Cammarata
parent 9e6ec4c6b0
commit 47651e6c22

View file

@ -159,7 +159,7 @@ class ModuleArgsParser:
# we don't allow users to set them directy in arguments
if action not in ('command', 'shell', 'script', 'raw'):
for arg in args:
if arg.startswith('_') and arg not in ('_raw_params'):
if arg.startswith('_ansible_'):
raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg))
# finally, update the args we're going to return with the ones