Properly use check_raw when using parse_kv in cli/ code

Fixes ansible-modules-core#3070
This commit is contained in:
James Cammarata 2016-03-21 11:00:07 -04:00
parent 407f8f934e
commit ae21d98955
2 changed files with 4 additions and 3 deletions

View file

@ -81,11 +81,12 @@ class AdHocCLI(CLI):
return True return True
def _play_ds(self, pattern, async, poll): def _play_ds(self, pattern, async, poll):
check_raw = self.options.module_name in ('command', 'shell', 'script', 'raw')
return dict( return dict(
name = "Ansible Ad-Hoc", name = "Ansible Ad-Hoc",
hosts = pattern, hosts = pattern,
gather_facts = 'no', gather_facts = 'no',
tasks = [ dict(action=dict(module=self.options.module_name, args=parse_kv(self.options.module_args)), async=async, poll=poll) ] tasks = [ dict(action=dict(module=self.options.module_name, args=parse_kv(self.options.module_args, check_raw=check_raw)), async=async, poll=poll) ]
) )
def run(self): def run(self):

View file

@ -183,12 +183,12 @@ class ConsoleCLI(CLI, cmd.Cmd):
result = None result = None
try: try:
check_raw = self.options.module_name in ('command', 'shell', 'script', 'raw')
play_ds = dict( play_ds = dict(
name = "Ansible Shell", name = "Ansible Shell",
hosts = self.options.cwd, hosts = self.options.cwd,
gather_facts = 'no', gather_facts = 'no',
#tasks = [ dict(action=dict(module=module, args=parse_kv(module_args)), async=self.options.async, poll=self.options.poll_interval) ] tasks = [ dict(action=dict(module=module, args=parse_kv(module_args, check_raw=check_raw)))]
tasks = [ dict(action=dict(module=module, args=parse_kv(module_args)))]
) )
play = Play().load(play_ds, variable_manager=self.variable_manager, loader=self.loader) play = Play().load(play_ds, variable_manager=self.variable_manager, loader=self.loader)
except Exception as e: except Exception as e: