LUQueryExports: fix rpcresult handling
authorGuido Trotter <ultrotter@google.com>
Wed, 3 Dec 2008 17:23:22 +0000 (17:23 +0000)
committerGuido Trotter <ultrotter@google.com>
Wed, 3 Dec 2008 17:23:22 +0000 (17:23 +0000)
call_export_list is a multi node call, so we need to go through the
results, extrapolate the good ones, and return a failure value for the
bad ones.

Reviewed-by: imsnah

lib/cmdlib.py

index 8771f66..7abf0f6 100644 (file)
@@ -5349,9 +5349,15 @@ class LUQueryExports(NoHooksLU):
         that node.
 
     """
-    result = self.rpc.call_export_list(self.nodes)
-    result.Raise()
-    return result.data
+    rpcresult = self.rpc.call_export_list(self.nodes)
+    result = {}
+    for node in rpcresult:
+      if rpcresult[node].failed:
+        result[node] = False
+      else:
+        result[node] = rpcresult[node].data
+
+    return result
 
 
 class LUExportInstance(LogicalUnit):