machine: extend allowed services

Allow all services that start with a match.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-06-02 17:41:52 -04:00
parent def6b365fa
commit 628c0193f3
1 changed files with 5 additions and 3 deletions

View File

@ -243,9 +243,11 @@ class Machine:
if ".service" in line.strip()]
except Exception:
services = []
for sname in ALLOWED_SERVICES:
if f"{sname}.service" in services:
self.available_services.append(sname)
for svc in services:
sname = svc.rsplit('.', 1)[0]
for allowed in ALLOWED_SERVICES:
if sname.startswith(allowed):
self.available_services.append(sname)
self.system_info['available_services'] = self.available_services