Revision 140aa4a8

b/lib/bootstrap.py
230 230
  rpc.call_node_start_master(hostname.name, True)
231 231

  
232 232

  
233
def FinalizeClusterDestroy(master):
234
  """Execute the last steps of cluster destroy
235

  
236
  This function shuts down all the daemons, completing the destroy
237
  begun in cmdlib.LUDestroyOpcode.
238

  
239
  """
240
  if not rpc.call_node_stop_master(master, True):
241
    logging.warning("Could not disable the master role")
242
  if not rpc.call_node_leave_cluster(master):
243
    logging.warning("Could not shutdown the node daemon and cleanup the node")
244

  
245

  
233 246
def SetupNodeDaemon(node):
234 247
  """Add a node to the cluster.
235 248

  
b/lib/cmdlib.py
481 481
    priv_key, pub_key, _ = ssh.GetUserFiles(constants.GANETI_RUNAS)
482 482
    utils.CreateBackup(priv_key)
483 483
    utils.CreateBackup(pub_key)
484
    rpc.call_node_leave_cluster(master)
484
    return master
485 485

  
486 486

  
487 487
class LUVerifyCluster(LogicalUnit):
b/scripts/gnt-cluster
74 74
    return 1
75 75

  
76 76
  op = opcodes.OpDestroyCluster()
77
  SubmitOpCode(op)
77
  master = SubmitOpCode(op)
78
  # if we reached this, the opcode didn't fail; we can proceed to
79
  # shutdown all the daemons
80
  bootstrap.FinalizeClusterDestroy(master)
78 81
  return 0
79 82

  
80 83

  

Also available in: Unified diff