1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

machinectl: include the success command (#5287)

Combines the success command when building the become command. This is
consistent with other become plugins.
This commit is contained in:
Ben Brown 2022-09-25 20:09:08 +01:00 committed by GitHub
parent d9d830a168
commit f3bcfa5a75
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') flags = self.get_option('become_flags')
user = self.get_option('become_user') 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): def check_success(self, b_output):
b_output = self.remove_ansi_codes(b_output) b_output = self.remove_ansi_codes(b_output)