Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37052 - Use correct tracer types #151

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/katello/tracer/deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def use_needrestart():
apps.append(app)

for service in services:
app = AptTracerApp(service, "systemctl restart " + service, "systemd")
app = AptTracerApp(service, "systemctl restart " + service, "daemon")
apps.append(app)

return apps
Expand Down
2 changes: 1 addition & 1 deletion src/katello/tracer/zypper.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def collect_services_state():
output = execute_zypper_ps()
for service in output:
if service:
app = ZypperTracerApp(service, "systemctl restart " + service, "systemd")
app = ZypperTracerApp(service, "systemctl restart " + service, "daemon")
apps.append(app)
return apps

Expand Down
4 changes: 2 additions & 2 deletions test/test_katello/test_tracer/test_deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_service_restart(self, m):
# Validate service
self.assertEqual(apps[0].name, "systemd-logind")
self.assertEqual(apps[0].helper, "systemctl restart systemd-logind")
self.assertEqual(apps[0].type, "systemd")
self.assertEqual(apps[0].type, "daemon")

@patch("katello.tracer.deb.needrestart")
def test_service_and_system_restart(self, m):
Expand All @@ -139,7 +139,7 @@ def test_service_and_system_restart(self, m):
# Validate service
self.assertEqual(apps[1].name, "systemd-logind")
self.assertEqual(apps[1].helper, "systemctl restart systemd-logind")
self.assertEqual(apps[1].type, "systemd")
self.assertEqual(apps[1].type, "daemon")
# Validate kernel
self.assertEqual(apps[0].name, "kernel")
self.assertEqual(apps[0].helper, "Please restart your system")
Expand Down
4 changes: 2 additions & 2 deletions test/test_katello/test_tracer/test_zypper.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_service_restart(self, m):
# Validate service
self.assertEqual(apps[0].name, "systemd-logind")
self.assertEqual(apps[0].helper, "systemctl restart systemd-logind")
self.assertEqual(apps[0].type, "systemd")
self.assertEqual(apps[0].type, "daemon")

@patch("katello.tracer.zypper.execute_zypper_ps")
def test_no_service_restart_needed(self, m):
Expand All @@ -88,7 +88,7 @@ def test_collect_apps_reboot(self, m, p):
@patch("katello.tracer.zypper.collect_services_state")
@patch("katello.tracer.zypper.check_for_reboot_flag")
def test_collect_apps_services(self, m, p):
expected_output = [ZypperTracerApp("systemd-logind", "systemctl restart systemd-logind", "systemd")] + []
expected_output = [ZypperTracerApp("systemd-logind", "systemctl restart systemd-logind", "daemon")] + []
m.return_value = [expected_output[0]]
p.return_value = []
actual_output = collect_apps()
Expand Down
Loading