machinectl: include the success command (#5287) (#5312)

Combines the success command when building the become command. This is
consistent with other become plugins.

(cherry picked from commit f3bcfa5a75)

Co-authored-by: Ben Brown <ben@demerara.io>
pull/5317/head
patchback[bot] 2022-09-28 13:57:10 +02:00 committed by GitHub
parent f9fecf12e7
commit 8beb5d70c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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).

View File

@ -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)