diff --git a/command b/command index 61d78ec5632..1b11257de20 100755 --- a/command +++ b/command @@ -22,8 +22,8 @@ import subprocess import sys import datetime import traceback +import re import shlex -import pipes import os DOCUMENTATION = ''' @@ -131,7 +131,6 @@ class CommandModule(AnsibleModule): def _load_params(self): ''' read the input and return a dictionary and the arguments string ''' args = MODULE_ARGS - items = shlex.split(args) params = {} params['chdir'] = None params['shell'] = False @@ -139,14 +138,13 @@ class CommandModule(AnsibleModule): args = args.replace("#USE_SHELL", "") params['shell'] = True - check_args = shlex.split(args) - l_args = [] - for x in check_args: - if x.startswith("creates="): + r = re.compile(r'(^|\s)(creates|removes|chdir)=(?P[\'"])?(.*?)(?(quote)(?