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
2 changed files with 3 additions and 1 deletions

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)