Fix backend.VerifyNode behaviour for VG problems
authorIustin Pop <iustin@google.com>
Thu, 18 Mar 2010 09:54:24 +0000 (10:54 +0100)
committerIustin Pop <iustin@google.com>
Tue, 23 Mar 2010 08:35:05 +0000 (09:35 +0100)
In case LVM is broken, backend.GetVolumeList will raise an RPC exception
(as expected since it's a function exposed over RPC). Therefore we must
be prepared to catch any such exceptions, so that we don't fail the
whole verify call in this case. cmdlib is already prepared to handle
string results for this response key.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/backend.py

index 9b98a76..ebbc43a 100644 (file)
@@ -524,7 +524,11 @@ def VerifyNode(what, cluster_name):
                        " and ".join(fail))
 
   if constants.NV_LVLIST in what:
-    result[constants.NV_LVLIST] = GetVolumeList(what[constants.NV_LVLIST])
+    try:
+      val = GetVolumeList(what[constants.NV_LVLIST])
+    except RPCFail, err:
+      val = str(err)
+    result[constants.NV_LVLIST] = val
 
   if constants.NV_INSTANCELIST in what:
     # GetInstanceList can fail