From 165fff8a1e6e9f5ed6d1d10c136c8c9fbd2a88c1 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 15 Jul 2015 11:56:01 -0400 Subject: [PATCH] Fixing module arg parsing splitting when action is a variable Fixes #11122 --- lib/ansible/parsing/mod_args.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ansible/parsing/mod_args.py b/lib/ansible/parsing/mod_args.py index d7cc83a9055..ae86471a2d8 100644 --- a/lib/ansible/parsing/mod_args.py +++ b/lib/ansible/parsing/mod_args.py @@ -23,7 +23,7 @@ from six import iteritems, string_types from ansible.errors import AnsibleParserError from ansible.plugins import module_loader -from ansible.parsing.splitter import parse_kv +from ansible.parsing.splitter import parse_kv, split_args # For filtering out modules correctly below RAW_PARAM_MODULES = ([ @@ -91,7 +91,7 @@ class ModuleArgsParser: self._task_ds = task_ds - def _split_module_string(self, str): + def _split_module_string(self, module_string): ''' when module names are expressed like: action: copy src=a dest=b @@ -99,7 +99,7 @@ class ModuleArgsParser: and the rest are strings pertaining to the arguments. ''' - tokens = str.split() + tokens = split_args(module_string) if len(tokens) > 1: return (tokens[0], " ".join(tokens[1:])) else: @@ -240,17 +240,13 @@ class ModuleArgsParser: args = dict() - # - # We can have one of action, local_action, or module specified - # - - # this is the 'extra gross' scenario detailed above, so we grab # the args and pass them in as additional arguments, which can/will # be overwritten via dict updates from the other arg sources below # FIXME: add test cases for this additional_args = self._task_ds.get('args', dict()) + # We can have one of action, local_action, or module specified # action if 'action' in self._task_ds: # an old school 'action' statement