pagekite: Fix issue with adding custom services

Tests:

- Adding and deleting a custom service no longer results in an error message.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2026-03-11 22:34:40 -07:00 committed by James Valleroy
parent 6bb6969eef
commit acd5477b11
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -117,7 +117,7 @@ def set_config(frontend: str, kite_name: str, kite_secret: secret_str):
@privileged
def remove_service(service: dict[str, str]):
def remove_service(service: dict[str, str | bool]):
"""Search and remove the service(s) that match all given parameters."""
aug = _augeas_load()
service = utils.load_service(service)
@ -132,7 +132,7 @@ def remove_service(service: dict[str, str]):
lines = file.readlines()
for i, line in enumerate(lines):
if line.startswith('service_on') and \
all(param in line for param in service.values()):
all(str(param) in line for param in service.values()):
lines[i] = ""
service_found = True
break
@ -170,7 +170,7 @@ def _add_service(aug, service):
@privileged
def add_service(service: dict[str, str]):
def add_service(service: dict[str, str | bool]):
"""Add one service."""
aug = _augeas_load()
service = utils.load_service(service)