Commit 6ec77900 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

Fix payload check for out-of-band health



This logic error was not detected before as health has not been
implemented on the cli and therefore no QA code existed for that.
Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent edd8fe4c
......@@ -3296,10 +3296,11 @@ class LUOobCommand(NoHooksLU):
if not isinstance(result.payload, list):
errs.append("command 'health' is expected to return a list but got %s" %
type(result.payload))
for item, status in result.payload:
if status not in constants.OOB_STATUSES:
errs.append("health item '%s' has invalid status '%s'" %
(item, status))
else:
for item, status in result.payload:
if status not in constants.OOB_STATUSES:
errs.append("health item '%s' has invalid status '%s'" %
(item, status))
if self.op.command == constants.OOB_POWER_STATUS:
if not isinstance(result.payload, dict):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment