Revision 07bd8a51 scripts/gnt-cluster

b/scripts/gnt-cluster
64 64
  return 0
65 65

  
66 66

  
67
def RenameCluster(opts, args):
68
  """Rename the cluster.
69

  
70
  Args:
71
    opts - class with options as members, we use force only
72
    args - list of arguments, expected to be [new_name]
73

  
74
  """
75
  name = args[0]
76
  if not opts.force:
77
    usertext = ("This will rename the cluster to '%s'. If you are connected"
78
                " over the network to the cluster name, the operation is very"
79
                " dangerous as the IP address will be removed from the node"
80
                " and the change may not go through. Continue?") % name
81
    if not opts._ask_user(usertext):
82
      return 1
83

  
84
  op = opcodes.OpRenameCluster(name=name)
85
  SubmitOpCode(op)
86
  return 0
87

  
88

  
67 89
def ShowClusterVersion(opts, args):
68 90
  """Write version of ganeti software to the standard output.
69 91

  
......
222 244
                           action="store_true"),
223 245
              ],
224 246
              "", "Destroy cluster"),
247
  'rename': (RenameCluster, ARGS_ONE, [DEBUG_OPT, FORCE_OPT],
248
               "<new_name>",
249
               "Renames the cluster"),
225 250
  'verify': (VerifyCluster, ARGS_NONE, [DEBUG_OPT],
226 251
             "", "Does a check on the cluster configuration"),
227 252
  'masterfailover': (MasterFailover, ARGS_NONE, [DEBUG_OPT],

Also available in: Unified diff