Skip to content

Commit

Permalink
Added quiet parameter to systemd so start and stop would be muted
Browse files Browse the repository at this point in the history
  • Loading branch information
silverdrake11 authored and Perfect5th committed Aug 15, 2023
1 parent eac96a1 commit 7e109a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion landscape/client/serviceconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _call_systemctl(
stdout.
"""
return subprocess.run(
[SYSTEMCTL, action, SYSTEMD_SERVICE],
[SYSTEMCTL, action, SYSTEMD_SERVICE, "--quiet"],
stdout=subprocess.PIPE,
**run_kwargs,
)
Expand Down
16 changes: 8 additions & 8 deletions landscape/client/tests/test_serviceconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ def setUp(self):
def test_set_to_run_on_boot(self):
SystemdConfig.set_start_on_boot(True)
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "enable", "landscape-client.service"],
[SYSTEMCTL, "enable", "landscape-client.service", "--quiet"],
stdout=subprocess.PIPE,
)

def test_set_to_not_run_on_boot(self):
SystemdConfig.set_start_on_boot(False)
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "disable", "landscape-client.service"],
[SYSTEMCTL, "disable", "landscape-client.service", "--quiet"],
stdout=subprocess.PIPE,
)

Expand All @@ -39,7 +39,7 @@ def test_configured_to_run(self):

self.assertTrue(SystemdConfig.is_configured_to_run())
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "is-enabled", "landscape-client.service"],
[SYSTEMCTL, "is-enabled", "landscape-client.service", "--quiet"],
stdout=subprocess.PIPE,
)

Expand All @@ -48,14 +48,14 @@ def test_not_configured_to_run(self):

self.assertFalse(SystemdConfig.is_configured_to_run())
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "is-enabled", "landscape-client.service"],
[SYSTEMCTL, "is-enabled", "landscape-client.service", "--quiet"],
stdout=subprocess.PIPE,
)

def test_run_landscape(self):
SystemdConfig.restart_landscape()
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "restart", "landscape-client.service"],
[SYSTEMCTL, "restart", "landscape-client.service", "--quiet"],
check=True,
stdout=subprocess.PIPE,
)
Expand All @@ -68,15 +68,15 @@ def test_run_landscape_exception(self):
SystemdConfig.restart_landscape,
)
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "restart", "landscape-client.service"],
[SYSTEMCTL, "restart", "landscape-client.service", "--quiet"],
check=True,
stdout=subprocess.PIPE,
)

def test_stop_landscape(self):
SystemdConfig.stop_landscape()
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "stop", "landscape-client.service"],
[SYSTEMCTL, "stop", "landscape-client.service", "--quiet"],
check=True,
stdout=subprocess.PIPE,
)
Expand All @@ -89,7 +89,7 @@ def test_stop_landscape_exception(self):
SystemdConfig.stop_landscape,
)
self.run_mock.assert_called_once_with(
[SYSTEMCTL, "stop", "landscape-client.service"],
[SYSTEMCTL, "stop", "landscape-client.service", "--quiet"],
check=True,
stdout=subprocess.PIPE,
)
Expand Down

0 comments on commit 7e109a3

Please sign in to comment.