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:
parent
d9d830a168
commit
f3bcfa5a75
2 changed files with 3 additions and 1 deletions
2
changelogs/fragments/5287-machinectl-become-success.yml
Normal file
2
changelogs/fragments/5287-machinectl-become-success.yml
Normal 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).
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue