From f3bcfa5a75ef93bb36e3e050d62261ff74a66cd9 Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Sun, 25 Sep 2022 20:09:08 +0100 Subject: [PATCH] machinectl: include the success command (#5287) Combines the success command when building the become command. This is consistent with other become plugins. --- changelogs/fragments/5287-machinectl-become-success.yml | 2 ++ plugins/become/machinectl.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/5287-machinectl-become-success.yml diff --git a/changelogs/fragments/5287-machinectl-become-success.yml b/changelogs/fragments/5287-machinectl-become-success.yml new file mode 100644 index 0000000000..3f71831e29 --- /dev/null +++ b/changelogs/fragments/5287-machinectl-become-success.yml @@ -0,0 +1,2 @@ +minor_changes: + - machinectl become plugin - combine the success command when building the become command to be consistent with other become plugins (https://github.com/ansible-collections/community.general/pull/5287). diff --git a/plugins/become/machinectl.py b/plugins/become/machinectl.py index 3e13dfc2a5..461a3f635d 100644 --- a/plugins/become/machinectl.py +++ b/plugins/become/machinectl.py @@ -117,7 +117,7 @@ class BecomeModule(BecomeBase): flags = self.get_option('become_flags') user = self.get_option('become_user') - return '%s -q shell %s %s@ %s' % (become, flags, user, cmd) + return '%s -q shell %s %s@ %s' % (become, flags, user, self._build_success_command(cmd, shell)) def check_success(self, b_output): b_output = self.remove_ansi_codes(b_output)