From 6aecd7b26d79985f3a90457e1ae96ebd4d4402ef Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 25 Jan 2022 18:26:34 -0500 Subject: [PATCH] machine: add "none" provider When the "none" provider is set service action APIs will be disabled and return an error when called. Service state tracking is also disabled. Signed-off-by: Eric Callahan --- moonraker/components/machine.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moonraker/components/machine.py b/moonraker/components/machine.py index bb8e5aa..74bc683 100644 --- a/moonraker/components/machine.py +++ b/moonraker/components/machine.py @@ -67,6 +67,7 @@ class Machine: } self._update_log_rollover(log=True) providers: Dict[str, type] = { + "none": BaseProvider, "systemd_cli": SystemdCliProvider, "systemd_dbus": SystemdDbusProvider } @@ -391,10 +392,13 @@ class BaseProvider: action: str, service_name: str ) -> None: - pass + raise self.server.error("Serice Actions Not Available", 503) async def check_virt_status(self) -> Dict[str, Any]: - pass + return { + 'virt_type': "unknown", + 'virt_identifier': "unknown" + } def is_service_available(self, service: str) -> bool: return service in self.available_services