Switch parameters validation after parsing in order to be more consistent between old and new style.

This commit is contained in:
Yannig Perré 2015-11-26 18:24:12 +02:00
commit 2c54fb1339
2 changed files with 8 additions and 6 deletions

View file

@ -83,11 +83,6 @@ def parse_kv(args, check_raw=False):
k = x[:pos]
v = x[pos + 1:]
# only internal variables can start with an underscore, so
# we don't allow users to set them directy in arguments
if k.startswith('_'):
raise AnsibleError("invalid parameter specified: '%s'" % k)
# FIXME: make the retrieval of this list of shell/command
# options a function, so the list is centralized
if check_raw and k not in ('creates', 'removes', 'chdir', 'executable', 'warn'):