Fix LUClusterRepairDiskSizes and rpc result usage
authorIustin Pop <iustin@google.com>
Tue, 15 Feb 2011 13:39:44 +0000 (14:39 +0100)
committerIustin Pop <iustin@google.com>
Fri, 4 Mar 2011 10:41:38 +0000 (11:41 +0100)
This LU was introduced before the RPC result conversion from .data to
.payload, and it has managed to keep the old-style usage (how? it's
the only LU that does so). Fix by changing to payload, and add some
extra logging for easier diagnose.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Stephen Shirley <diamond@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
(cherry picked from commit 043beb38f4e10b75d0820c361c668c441c7a6980)

lib/cmdlib.py

index 8377896..6af9d44 100644 (file)
@@ -2489,11 +2489,13 @@ class LURepairDiskSizes(NoHooksLU):
         self.LogWarning("Failure in blockdev_getsize call to node"
                         " %s, ignoring", node)
         continue
-      if len(result.data) != len(dskl):
+      if len(result.payload) != len(dskl):
+        logging.warning("Invalid result from node %s: len(dksl)=%d,"
+                        " result.payload=%s", node, len(dskl), result.payload)
         self.LogWarning("Invalid result from node %s, ignoring node results",
                         node)
         continue
-      for ((instance, idx, disk), size) in zip(dskl, result.data):
+      for ((instance, idx, disk), size) in zip(dskl, result.payload):
         if size is None:
           self.LogWarning("Disk %d of instance %s did not return size"
                           " information, ignoring", idx, instance.name)