summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatt Davis <nitzmahone@users.noreply.github.com>2016-09-15 11:25:56 -0700
committerGitHub <noreply@github.com>2016-09-15 11:25:56 -0700
commitf497d771c8bda7874382bbffbf641eaedf015f94 (patch)
treeed5f39dfb0f54d6b24cd26c09913ededce7312b6 /lib
parent81072fcba10d6436babe3e0cd7525f857143a985 (diff)
downloadansible-f497d771c8bda7874382bbffbf641eaedf015f94.tar.gz
win_shell/win_command changes + tests (#17557)
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/cli/adhoc.py2
-rw-r--r--lib/ansible/constants.py4
-rw-r--r--lib/ansible/parsing/mod_args.py8
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/ansible/cli/adhoc.py b/lib/ansible/cli/adhoc.py
index 95ab640ded..1b615473e0 100644
--- a/lib/ansible/cli/adhoc.py
+++ b/lib/ansible/cli/adhoc.py
@@ -85,7 +85,7 @@ class AdHocCLI(CLI):
return True
def _play_ds(self, pattern, async, poll):
- check_raw = self.options.module_name in ('command', 'shell', 'script', 'raw')
+ check_raw = self.options.module_name in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw')
return dict(
name = "Ansible Ad-Hoc",
hosts = pattern,
diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py
index 0cc4c343dc..606fb3c194 100644
--- a/lib/ansible/constants.py
+++ b/lib/ansible/constants.py
@@ -326,8 +326,8 @@ COLOR_DIFF_LINES = get_config(p, 'colors', 'diff_lines', 'ANSIBLE_COLOR_DIFF_LI
DIFF_CONTEXT = get_config(p, 'diff', 'context', 'ANSIBLE_DIFF_CONTEXT', 3, integer=True)
# non-configurable things
-MODULE_REQUIRE_ARGS = ['command', 'shell', 'raw', 'script']
-MODULE_NO_JSON = ['command', 'shell', 'raw']
+MODULE_REQUIRE_ARGS = ['command', 'win_command', 'shell', 'win_shell', 'raw', 'script']
+MODULE_NO_JSON = ['command', 'win_command', 'shell', 'win_shell', 'raw']
DEFAULT_BECOME_PASS = None
DEFAULT_SUDO_PASS = None
DEFAULT_REMOTE_PASS = None
diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py
index dbe85b0bad..a311156ae9 100644
--- a/lib/ansible/parsing/mod_args.py
+++ b/lib/ansible/parsing/mod_args.py
@@ -29,7 +29,9 @@ from ansible.template import Templar
# For filtering out modules correctly below
RAW_PARAM_MODULES = ([
'command',
+ 'win_command',
'shell',
+ 'win_shell',
'script',
'include',
'include_vars',
@@ -161,7 +163,7 @@ class ModuleArgsParser:
# only internal variables can start with an underscore, so
# we don't allow users to set them directy in arguments
- if args and action not in ('command', 'shell', 'script', 'raw'):
+ if args and action not in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw'):
for arg in args:
if arg.startswith('_ansible_'):
raise AnsibleError("invalid parameter specified for action '%s': '%s'" % (action, arg))
@@ -191,7 +193,7 @@ class ModuleArgsParser:
args = thing
elif isinstance(thing, string_types):
# form is like: local_action: copy src=a dest=b ... pretty common
- check_raw = action in ('command', 'shell', 'script', 'raw')
+ check_raw = action in ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw')
args = parse_kv(thing, check_raw=check_raw)
elif thing is None:
# this can happen with modules which take no params, like ping:
@@ -217,7 +219,7 @@ class ModuleArgsParser:
action = None
args = None
- actions_allowing_raw = ('command', 'shell', 'script', 'raw')
+ actions_allowing_raw = ('command', 'win_command', 'shell', 'win_shell', 'script', 'raw')
if isinstance(thing, dict):
# form is like: copy: { src: 'a', dest: 'b' } ... common for structured (aka "complex") args
thing = thing.copy()