Merge "Add systemd stop unit command"

This commit is contained in:
Zuul 2022-04-01 14:11:46 +00:00 committed by Gerrit Code Review
commit 2bb81c93d1
2 changed files with 8 additions and 0 deletions

View File

@ -116,6 +116,7 @@ SSHShellProcessFixture = _ssh.SSHShellProcessFixture
SystemdUnit = _systemctl.SystemdUnit
match_unit_state = _systemctl.match_unit_state
list_systemd_units = _systemctl.list_systemd_units
stop_systemd_unit = _systemctl.stop_systemd_unit
wait_for_active_systemd_units = _systemctl.wait_for_active_systemd_units
wait_for_systemd_units_state = _systemctl.wait_for_systemd_units_state

View File

@ -116,6 +116,13 @@ def list_systemd_units(*pattern: str,
return units
def stop_systemd_unit(unit,
ssh_client: ssh.SSHClientType = None,
sudo: bool = None):
command = systemctl_command('stop', unit)
return _execute.execute(command, ssh_client=ssh_client, sudo=sudo)
def wait_for_active_systemd_units(*pattern: str,
state: str = None,
type: str = None,