From dd9e9f9ce276368cc2fcd5025001fe17287640ca Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 3 Feb 2010 14:24:53 +0100
Subject: [PATCH] Second try to fix LUVerifyCluster

My previous patch, commit 785d142, fixed the case where a node is marked
offline. With this patch it'll also handle other failures correctly.

 * Hooks Results
   - ERROR: node node2.example.com: Communication failure in hooks
   execution: Connection failed (111: Connection refused)

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

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 93abd9c47..a632bb71a 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -1603,8 +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 res.offline:
-          # No need to investigate payload if node is offline.
+        if res.offline or msg:
+          # No need to investigate payload if node is offline or gave an error.
           # override manually lu_result here as _ErrorIf only
           # overrides self.bad
           lu_result = 1
-- 
GitLab