From 18c8f361e2fa44ab1d60c667ad7331eb93562fb5 Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Mon, 14 Dec 2009 17:54:58 +0100
Subject: [PATCH] CreateInstance: allow no ip check with start mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Since gnt-instance start doesn't do any checks on the IP, it doesn't
make much sense to do so in instance create (with start) if the user
expressly passes in β€˜--no-ip-check’. Removing this requirement eases the
no-name-check mode (otherwise one would have to create --no-start and
then only start).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
---
 lib/cmdlib.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 0fa8bdc1c..bd0e9b151 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -6013,12 +6013,8 @@ class LUCreateInstance(LogicalUnit):
             nic.mac = export_info.get(constants.INISECT_INS, nic_mac_ini)
 
     # ENDIF: self.op.mode == constants.INSTANCE_IMPORT
-    # ip ping checks (we use the same ip that was resolved in ExpandNames)
-    if self.op.start and not self.op.ip_check:
-      raise errors.OpPrereqError("Cannot ignore IP address conflicts when"
-                                 " adding an instance in start mode",
-                                 errors.ECODE_INVAL)
 
+    # ip ping checks (we use the same ip that was resolved in ExpandNames)
     if self.op.ip_check:
       if utils.TcpPing(self.check_ip, constants.DEFAULT_NODED_PORT):
         raise errors.OpPrereqError("IP %s of instance %s already in use" %
-- 
GitLab