Skip to content

Commit

Permalink
driver/powerdriver: raise NotImplementedError on PDUDaemonDriver.get()
Browse files Browse the repository at this point in the history
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 <bst@pengutronix.de>
  • Loading branch information
Bastian-Krause committed Apr 27, 2023
1 parent 6553635 commit 01480af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion labgrid/driver/powerdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

0 comments on commit 01480af

Please sign in to comment.