Convert finalize_export rpc to new style results
authorIustin Pop <iustin@google.com>
Tue, 9 Jun 2009 09:41:29 +0000 (11:41 +0200)
committerIustin Pop <iustin@google.com>
Mon, 15 Jun 2009 16:37:28 +0000 (18:37 +0200)
This rpc doesn't have explicit failure modes, but once all RPCs are
converted and we can catch and convert expceptions to failure in noded,
we will have meaningfull error messages.

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

lib/backend.py
lib/cmdlib.py

index 08b65aa..2983399 100644 (file)
@@ -1879,7 +1879,7 @@ def FinalizeExport(instance, snap_disks):
   shutil.rmtree(finaldestdir, True)
   shutil.move(destdir, finaldestdir)
 
-  return True
+  return True, None
 
 
 def ExportInfo(dest):
index 4d9502f..0394126 100644 (file)
@@ -6502,9 +6502,10 @@ class LUExportInstance(LogicalUnit):
                           " %s: %s", dev.logical_id[1], src_node, msg)
 
     result = self.rpc.call_finalize_export(dst_node.name, instance, snap_disks)
-    if result.failed or not result.data:
-      self.LogWarning("Could not finalize export for instance %s on node %s",
-                      instance.name, dst_node.name)
+    msg = result.RemoteFailMsg()
+    if msg:
+      self.LogWarning("Could not finalize export for instance %s"
+                      " on node %s: %s", instance.name, dst_node.name, msg)
 
     nodelist = self.cfg.GetNodeList()
     nodelist.remove(dst_node.name)