LUCreateInstance: the node list as return value
authorIustin Pop <iustin@google.com>
Fri, 19 Jun 2009 12:27:44 +0000 (14:27 +0200)
committerIustin Pop <iustin@google.com>
Fri, 19 Jun 2009 13:24:20 +0000 (15:24 +0200)
Currently LUCreateInstance has no result; this patch changes it so that
both the normal result and the dry-run result is the node list of the
selected instance.

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

lib/cmdlib.py

index de16fcc..03660c1 100644 (file)
@@ -4863,6 +4863,8 @@ class LUCreateInstance(LogicalUnit):
                            self.be_full[constants.BE_MEMORY],
                            self.op.hypervisor)
 
+    self.dry_run_result = list(nodenames)
+
   def Exec(self, feedback_fn):
     """Create and add the instance to the cluster.
 
@@ -4992,6 +4994,8 @@ class LUCreateInstance(LogicalUnit):
       result = self.rpc.call_instance_start(pnode_name, iobj, None, None)
       result.Raise("Could not start instance")
 
+    return list(iobj.all_nodes)
+
 
 class LUConnectConsole(NoHooksLU):
   """Connect to an instance's console.