From 785d142e6599d8ed39265b1f0edaf3714f82f9d7 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 3 Feb 2010 13:50:49 +0100
Subject: [PATCH] LUVerifyCluster: Fix bug with offline nodes
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[…]
 * Other Notes
   - NOTICE: 1 offline node(s) found.
 * Hooks Results
Failure: command execution error:
iteration over non-sequence

Commit a0c9776a introduced an error simulation mode to LUVerifyCluster.
Due to a small mistake, offline nodes weren't skipped when checking the
results of verification hooks and iterating over None raises an
β€œiteration over non-sequence” error.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/cmdlib.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index a063e9da4..93abd9c47 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1603,7 +1603,8 @@ class LUVerifyCluster(LogicalUnit):
         test = msg and not res.offline
         self._ErrorIf(test, self.ENODEHOOKS, node_name,
                       "Communication failure in hooks execution: %s", msg)
-        if test:
+        if res.offline:
+          # No need to investigate payload if node is offline.
           # override manually lu_result here as _ErrorIf only
           # overrides self.bad
           lu_result = 1
-- 
GitLab