Fix master role stop on cluster destroy
authorIustin Pop <iustin@google.com>
Fri, 29 Feb 2008 16:14:43 +0000 (16:14 +0000)
committerIustin Pop <iustin@google.com>
Fri, 29 Feb 2008 16:14:43 +0000 (16:14 +0000)
Currently the cluster destroy doesn't remove the master role, which
means that the IP address of the cluster remains assigned to the master
node.

This patch fixes this and also a docstring in backend.StopMaster().

Reviewed-by: imsnah

lib/backend.py
lib/cmdlib.py

index 608862a..ab03e76 100644 (file)
@@ -64,9 +64,7 @@ def StartMaster():
 def StopMaster():
   """Deactivate this node as master.
 
 def StopMaster():
   """Deactivate this node as master.
 
-  This does two things:
-    - run the master stop script
-    - remove link to master cron script.
+  This runs the master stop script.
 
   """
   result = utils.RunCmd([constants.MASTER_SCRIPT, "-d", "stop"])
 
   """
   result = utils.RunCmd([constants.MASTER_SCRIPT, "-d", "stop"])
index 10ee633..1c5356e 100644 (file)
@@ -632,6 +632,8 @@ class LUDestroyCluster(NoHooksLU):
 
     """
     master = self.sstore.GetMasterNode()
 
     """
     master = self.sstore.GetMasterNode()
+    if not rpc.call_node_stop_master(master):
+      raise errors.OpExecError("Could not disable the master role")
     priv_key, pub_key, _ = ssh.GetUserFiles(constants.GANETI_RUNAS)
     utils.CreateBackup(priv_key)
     utils.CreateBackup(pub_key)
     priv_key, pub_key, _ = ssh.GetUserFiles(constants.GANETI_RUNAS)
     utils.CreateBackup(priv_key)
     utils.CreateBackup(pub_key)