From 628c0193f3975547d572f91dc3bbac6297dfa846 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 2 Jun 2021 17:41:52 -0400 Subject: [PATCH] machine: extend allowed services Allow all services that start with a match. Signed-off-by: Eric Callahan --- moonraker/components/machine.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/moonraker/components/machine.py b/moonraker/components/machine.py index 9ac4cbd..411cf3e 100644 --- a/moonraker/components/machine.py +++ b/moonraker/components/machine.py @@ -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