LUCreateInstance: use cluster-wide iallocator
authorApollon Oikonomopoulos <apollon@noc.grnet.gr>
Thu, 8 Jul 2010 12:04:44 +0000 (15:04 +0300)
committerIustin Pop <iustin@google.com>
Thu, 8 Jul 2010 13:45:15 +0000 (15:45 +0200)
LUCreateInstance uses the cluster-wide default iallocator if no iallocator or
primary node is specified manually.

Signed-off-by: Apollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py

index d29c2b5..ae07551 100644 (file)
@@ -6541,10 +6541,7 @@ class LUCreateInstance(LogicalUnit):
                                  errors.ECODE_INVAL)
 
     ### Node/iallocator related checks
-    if [self.op.iallocator, self.op.pnode].count(None) != 1:
-      raise errors.OpPrereqError("One and only one of iallocator and primary"
-                                 " node must be given",
-                                 errors.ECODE_INVAL)
+    _CheckIAllocatorOrNode(self, "iallocator", "pnode")
 
     self._cds = _GetClusterDomainSecret()