Add systemd 'start unit' method

This patch adds 'start systemd unit' method for the tobiko systemd
module.

Change-Id: Icd537120c13438ee1134e40ba89d40d1d5bc430e
This commit is contained in:
Omer 2022-04-28 16:25:52 +02:00 committed by Federico Ressi
parent 89b6198fc5
commit 9076a69eb4
2 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,7 @@ SystemdUnit = _systemctl.SystemdUnit
match_unit_state = _systemctl.match_unit_state
list_systemd_units = _systemctl.list_systemd_units
stop_systemd_unit = _systemctl.stop_systemd_unit
start_systemd_unit = _systemctl.start_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

@ -123,6 +123,13 @@ def stop_systemd_unit(unit,
return _execute.execute(command, ssh_client=ssh_client, sudo=sudo)
def start_systemd_unit(unit,
ssh_client: ssh.SSHClientType = None,
sudo: bool = None):
command = systemctl_command('start', 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,