From 1b6dddc8ef7f7e230e3cd00a58a70416514c45e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20Nussbaumer?= <rn@google.com>
Date: Wed, 30 Jun 2010 14:40:45 +0200
Subject: [PATCH] Modify gnt-instance rename to support --no-check-name
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: RenΓ© Nussbaumer <rn@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 scripts/gnt-instance | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 82abc4df1..1e3dcf87f 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -620,9 +620,15 @@ def RenameInstance(opts, args):
   @return: the desired exit code
 
   """
+  if not opts.check_name:
+    if not AskUser("As you disabled the check of the DNS entry, please verify"
+                   " that '%s' is a FQDN. Continue?" % args[1]):
+      return 1
+
   op = opcodes.OpRenameInstance(instance_name=args[0],
                                 new_name=args[1],
-                                ignore_ip=not opts.ip_check)
+                                ignore_ip=not opts.ip_check,
+                                check_name=opts.check_name)
   SubmitOrSend(op, opts)
   return 0
 
@@ -1439,7 +1445,7 @@ commands = {
   'rename': (
     RenameInstance,
     [ArgInstance(min=1, max=1), ArgHost(min=1, max=1)],
-    [NOIPCHECK_OPT, SUBMIT_OPT],
+    [NOIPCHECK_OPT, NONAMECHECK_OPT, SUBMIT_OPT],
     "<instance> <new_name>", "Rename the instance"),
   'replace-disks': (
     ReplaceDisks, ARGS_ONE_INSTANCE,
-- 
GitLab