Querying node groups: add client/gnt_group.py
[ganeti-local] / lib / rpc.py
index 9090390..1c2065d 100644 (file)
@@ -1057,9 +1057,13 @@ class RpcRunner(object):
                                  [dict((name, [dsk.ToDict() for dsk in disks])
                                        for name, disks in node_disks.items())])
     for nres in result.values():
-      if not nres.fail_msg:
-        nres.payload = [objects.BlockDevStatus.FromDict(i)
-                        for i in nres.payload]
+      if nres.fail_msg:
+        continue
+
+      for idx, (success, status) in enumerate(nres.payload):
+        if success:
+          nres.payload[idx] = (success, objects.BlockDevStatus.FromDict(status))
+
     return result
 
   @_RpcTimeout(_TMO_NORMAL)
@@ -1172,6 +1176,16 @@ class RpcRunner(object):
     """
     return cls._StaticMultiNodeCall(node_list, "write_ssconf_files", [values])
 
+  @_RpcTimeout(_TMO_NORMAL)
+  def call_run_oob(self, node, oob_program, command, remote_node):
+    """Runs OOB.
+
+    This is a single-node call.
+
+    """
+    return self._SingleNodeCall(node, "run_oob", [oob_program, command,
+                                                  remote_node])
+
   @_RpcTimeout(_TMO_FAST)
   def call_os_diagnose(self, node_list):
     """Request a diagnose of OS definitions.