From 01480af51ba31831724d23710477f30ede2747dd Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Thu, 27 Apr 2023 14:18:34 +0200 Subject: [PATCH] driver/powerdriver: raise NotImplementedError on PDUDaemonDriver.get() pdudaemon does not implement port state retrieval. PDUDaemonDriver.get() returns None. This leads to cases where None is interpreted as "off", i.e. with constructs relying on `bool(drv.get())`. `labgrid-client power get` is one of those cases. So raise a NotImplementedError instead. Signed-off-by: Bastian Krause --- labgrid/driver/powerdriver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labgrid/driver/powerdriver.py b/labgrid/driver/powerdriver.py index bd59fa1ff..1e0befc85 100644 --- a/labgrid/driver/powerdriver.py +++ b/labgrid/driver/powerdriver.py @@ -411,4 +411,4 @@ def cycle(self): @Driver.check_active def get(self): - return None + raise NotImplementedError("pdudaemon does not support retrieving the port's state")