Skip to content

Commit b19f120

Browse files
committed
IPMIPowerPort: fix to not fail if no message and add exception messages
Empty output will be returned from ipmi tools if the device was already in the state requested.
1 parent de5df86 commit b19f120

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

labgrid/driver/powerdriver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,12 @@ def _ipmi_power(self, cmd):
510510
def _ipmi_cmd(self, cmd):
511511
ret = self._ipmi_power(cmd)
512512
stdout = ret.stdout.decode('utf-8').split(' ')
513-
assert self.port.host == stdout[0][:-1]
514-
assert "ok" == stdout[1][:-1]
513+
514+
if stdout[0] == '':
515+
return
516+
517+
assert self.port.host == stdout[0][:-1], f"unexpected stdout ({stdout})"
518+
assert "ok" == stdout[1][:-1], f"unexpected stdout ({stdout})"
515519

516520
@Driver.check_active
517521
@step()

0 commit comments

Comments
 (0)