From: René Nussbaumer Date: Tue, 25 Jan 2011 12:53:37 +0000 (+0100) Subject: Fix payload check for out-of-band health X-Git-Tag: v2.4.0rc1~50 X-Git-Url: https://code.grnet.gr/git/ganeti-local/commitdiff_plain/6ec7790087df0c55ef0ca68c384671e4b1ab69cb 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: René Nussbaumer Reviewed-by: Iustin Pop --- diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 032a0db..a39c8f8 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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):