From b15ff222b1d7ac043ebca4b61862e5dd17aadf05 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 5 Oct 2017 10:17:36 -0700 Subject: [PATCH] Revert "only set executable from shell if not set already" Reverted as this is a fix for 55135c0825f12db92ad02df1c493a7d0d4bcfaa8 which is being reverted for breakage This reverts commit e506b5da14c5a73eff5f9fa79f49dc86848b41f6. --- lib/ansible/module_utils/basic.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index 0f0197ec735..2852b238031 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -2603,7 +2603,7 @@ class AnsibleModule(object): if isinstance(args, list): if use_unsafe_shell: - args = " ".join([shlex_quote(x) for x in args]) + args = " ".join([pipes.quote(x) for x in args]) shell = True elif isinstance(args, (binary_type, text_type)) and use_unsafe_shell: shell = True @@ -2622,8 +2622,7 @@ class AnsibleModule(object): shell = False if use_unsafe_shell: - if executable is None: - executable = os.environ.get('SHELL') + executable = os.environ.get('SHELL') if executable: args = [executable, '-c', args] else: