diff --git a/lib/backend.py b/lib/backend.py index 608862aa2088bde67af5ec7a0b6d66c2b6cd7d5c..ab03e76e2b834475c3ec53ba4981055d4ff99487 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -64,9 +64,7 @@ def StartMaster(): 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"]) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 10ee633baae1f705fa3fb654fb30f19fc6fa7d8f..1c5356e6014401ed449632607c5b01b1bd1baab9 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -632,6 +632,8 @@ class LUDestroyCluster(NoHooksLU): """ 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)