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
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"])
"""
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)