Revision 6c00d19a
b/lib/backend.py | ||
---|---|---|
240 | 240 |
@rtype: None |
241 | 241 |
|
242 | 242 |
""" |
243 |
# TODO: log and report back to the caller the error failures; we |
|
244 |
# need to decide in which case we fail the RPC for this |
|
243 | 245 |
master_netdev, master_ip, _ = GetMasterInfo() |
244 | 246 |
if not master_netdev: |
245 |
return False |
|
247 |
return False, "Cluster configuration incomplete, cannot read ssconf files"
|
|
246 | 248 |
|
247 | 249 |
result = utils.RunCmd(["ip", "address", "del", "%s/32" % master_ip, |
248 | 250 |
"dev", master_netdev]) |
... | ... | |
255 | 257 |
for daemon in constants.RAPI_PID, constants.MASTERD_PID: |
256 | 258 |
utils.KillProcess(utils.ReadPidFile(utils.DaemonPidFileName(daemon))) |
257 | 259 |
|
258 |
return True |
|
260 |
return True, None
|
|
259 | 261 |
|
260 | 262 |
|
261 | 263 |
def AddNode(dsa, dsapub, rsa, rsapub, sshkey, sshpub): |
b/lib/bootstrap.py | ||
---|---|---|
318 | 318 |
|
319 | 319 |
""" |
320 | 320 |
result = rpc.RpcRunner.call_node_stop_master(master, True) |
321 |
if result.failed or not result.data: |
|
322 |
logging.warning("Could not disable the master role") |
|
321 |
msg = result.RemoteFailMsg() |
|
322 |
if msg: |
|
323 |
logging.warning("Could not disable the master role: %s" % msg) |
|
323 | 324 |
result = rpc.RpcRunner.call_node_leave_cluster(master) |
324 | 325 |
if result.failed or not result.data: |
325 | 326 |
logging.warning("Could not shutdown the node daemon and cleanup the node") |
... | ... | |
428 | 429 |
logging.info("Setting master to %s, old master: %s", new_master, old_master) |
429 | 430 |
|
430 | 431 |
result = rpc.RpcRunner.call_node_stop_master(old_master, True) |
431 |
if result.failed or not result.data: |
|
432 |
msg = result.RemoteFailMsg() |
|
433 |
if msg: |
|
432 | 434 |
logging.error("Could not disable the master role on the old master" |
433 |
" %s, please disable manually", old_master)
|
|
435 |
" %s, please disable manually: %s", old_master, msg)
|
|
434 | 436 |
|
435 | 437 |
# Here we have a phase where no master should be running |
436 | 438 |
|
b/lib/cmdlib.py | ||
---|---|---|
656 | 656 |
""" |
657 | 657 |
master = self.cfg.GetMasterNode() |
658 | 658 |
result = self.rpc.call_node_stop_master(master, False) |
659 |
result.Raise()
|
|
660 |
if not result.data:
|
|
661 |
raise errors.OpExecError("Could not disable the master role")
|
|
659 |
msg = result.RemoteFailMsg()
|
|
660 |
if msg:
|
|
661 |
raise errors.OpExecError("Could not disable the master role: %s" % msg)
|
|
662 | 662 |
priv_key, pub_key, _ = ssh.GetUserFiles(constants.GANETI_RUNAS) |
663 | 663 |
utils.CreateBackup(priv_key) |
664 | 664 |
utils.CreateBackup(pub_key) |
... | ... | |
1398 | 1398 |
# shutdown the master IP |
1399 | 1399 |
master = self.cfg.GetMasterNode() |
1400 | 1400 |
result = self.rpc.call_node_stop_master(master, False) |
1401 |
if result.failed or not result.data: |
|
1402 |
raise errors.OpExecError("Could not disable the master role") |
|
1401 |
msg = result.RemoteFailMsg() |
|
1402 |
if msg: |
|
1403 |
raise errors.OpExecError("Could not disable the master role: %s" % msg) |
|
1403 | 1404 |
|
1404 | 1405 |
try: |
1405 | 1406 |
cluster = self.cfg.GetClusterInfo() |
Also available in: Unified diff