mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-26 13:35:24 +02:00
Solved timer bug
This commit is contained in:
parent
fc4df980c5
commit
73b7d2728e
@ -22,7 +22,7 @@ def get_service_name(systemctl_id, software_name, suffix=""):
|
||||
if suffix is False:
|
||||
sfx = "" # no suffix at all
|
||||
elif suffix == "" or suffix is None:
|
||||
sfx = ".timer" if sid.endswith("@") else ".service"
|
||||
sfx = ".service"
|
||||
else:
|
||||
sfx = "." + str(suffix).strip().lower()
|
||||
|
||||
|
@ -8,10 +8,10 @@ class TestGetServiceName(unittest.TestCase):
|
||||
"sys-ctl-cln-backups.nginx.service"
|
||||
)
|
||||
|
||||
def test_default_suffix_timer(self):
|
||||
def test_default_suffix(self):
|
||||
self.assertEqual(
|
||||
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):
|
||||
|
Loading…
x
Reference in New Issue
Block a user