summaryrefslogtreecommitdiffstats
path: root/lib/ansible/plugins/shell
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:26:57 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:26:57 +0000
commitd4dfa10cd25391c61bd21fa7c3e08d1ba955b52a (patch)
tree3492abc44856eb055528b4163280c0e4a4d0e7cc /lib/ansible/plugins/shell
parentReleasing progress-linux version 2.17.1-1~progress7.99u1. (diff)
downloadansible-core-d4dfa10cd25391c61bd21fa7c3e08d1ba955b52a.tar.xz
ansible-core-d4dfa10cd25391c61bd21fa7c3e08d1ba955b52a.zip
Merging upstream version 2.17.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/plugins/shell')
-rw-r--r--lib/ansible/plugins/shell/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/ansible/plugins/shell/__init__.py b/lib/ansible/plugins/shell/__init__.py
index 56be533..49bbb01 100644
--- a/lib/ansible/plugins/shell/__init__.py
+++ b/lib/ansible/plugins/shell/__init__.py
@@ -211,7 +211,11 @@ class ShellBase(AnsiblePlugin):
arg_path,
]
- return f'{env_string}%s' % shlex.join(cps for cp in cmd_parts if cp and (cps := cp.strip()))
+ cleaned_up_cmd = shlex.join(
+ stripped_cmd_part for raw_cmd_part in cmd_parts
+ if raw_cmd_part and (stripped_cmd_part := raw_cmd_part.strip())
+ )
+ return ''.join((env_string, cleaned_up_cmd))
def append_command(self, cmd, cmd_to_append):
"""Append an additional command if supported by the shell"""