pmrun - quote success command (#66929)

* Recreate the older behavior where the entire success command was quoted

* Use shlex_quote for a correct fix of this

* Add changelog fragment
pull/67212/head
Allen Smith 4 years ago committed by GitHub
parent 8fa233ba1e
commit fd8eb77cc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- pmrun plugin - The success_command string was no longer quoted. This caused unusual use-cases like ``become_flags=su - root -c`` to fail.

@ -57,6 +57,7 @@ DOCUMENTATION = """
"""
from ansible.plugins.become import BecomeBase
from ansible.module_utils.six.moves import shlex_quote
class BecomeModule(BecomeBase):
@ -72,4 +73,4 @@ class BecomeModule(BecomeBase):
become = self.get_option('become_exe') or self.name
flags = self.get_option('become_flags') or ''
return '%s %s %s' % (become, flags, self._build_success_command(cmd, shell))
return '%s %s %s' % (become, flags, shlex_quote(self._build_success_command(cmd, shell)))

Loading…
Cancel
Save