Solved timer bug

This commit is contained in:
Kevin Veen-Birkenbach 2025-08-19 00:33:00 +02:00
parent fc4df980c5
commit 73b7d2728e
No known key found for this signature in database
GPG Key ID: 44D8F11FD62F878E
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ def get_service_name(systemctl_id, software_name, suffix=""):
if suffix is False: if suffix is False:
sfx = "" # no suffix at all sfx = "" # no suffix at all
elif suffix == "" or suffix is None: elif suffix == "" or suffix is None:
sfx = ".timer" if sid.endswith("@") else ".service" sfx = ".service"
else: else:
sfx = "." + str(suffix).strip().lower() sfx = "." + str(suffix).strip().lower()

View File

@ -8,10 +8,10 @@ class TestGetServiceName(unittest.TestCase):
"sys-ctl-cln-backups.nginx.service" "sys-ctl-cln-backups.nginx.service"
) )
def test_default_suffix_timer(self): def test_default_suffix(self):
self.assertEqual( self.assertEqual(
get_service_name.get_service_name("sys-ctl-bkp@", "postgres"), get_service_name.get_service_name("sys-ctl-bkp@", "postgres"),
"sys-ctl-bkp.postgres@.timer" "sys-ctl-bkp.postgres@.service"
) )
def test_explicit_custom_suffix(self): def test_explicit_custom_suffix(self):