Revision 1c3231aa lib/server/masterd.py
b/lib/server/masterd.py | ||
---|---|---|
519 | 519 |
self.jobqueue.AddNode(node) |
520 | 520 |
|
521 | 521 |
# Add the new node to the Ganeti Lock Manager |
522 |
self.glm.add(locking.LEVEL_NODE, node.name)
|
|
523 |
self.glm.add(locking.LEVEL_NODE_RES, node.name)
|
|
522 |
self.glm.add(locking.LEVEL_NODE, node.uuid)
|
|
523 |
self.glm.add(locking.LEVEL_NODE_RES, node.uuid)
|
|
524 | 524 |
|
525 | 525 |
def ReaddNode(self, node): |
526 | 526 |
"""Updates a node that's already in the configuration |
... | ... | |
529 | 529 |
# Synchronize the queue again |
530 | 530 |
self.jobqueue.AddNode(node) |
531 | 531 |
|
532 |
def RemoveNode(self, name):
|
|
532 |
def RemoveNode(self, node):
|
|
533 | 533 |
"""Removes a node from the configuration and lock manager. |
534 | 534 |
|
535 | 535 |
""" |
536 | 536 |
# Remove node from configuration |
537 |
self.cfg.RemoveNode(name)
|
|
537 |
self.cfg.RemoveNode(node.uuid)
|
|
538 | 538 |
|
539 | 539 |
# Notify job queue |
540 |
self.jobqueue.RemoveNode(name) |
|
540 |
self.jobqueue.RemoveNode(node.name)
|
|
541 | 541 |
|
542 | 542 |
# Remove the node from the Ganeti Lock Manager |
543 |
self.glm.remove(locking.LEVEL_NODE, name)
|
|
544 |
self.glm.remove(locking.LEVEL_NODE_RES, name)
|
|
543 |
self.glm.remove(locking.LEVEL_NODE, node.uuid)
|
|
544 |
self.glm.remove(locking.LEVEL_NODE_RES, node.uuid)
|
|
545 | 545 |
|
546 | 546 |
|
547 | 547 |
def _SetWatcherPause(context, until): |
... | ... | |
602 | 602 |
myself = netutils.Hostname.GetSysName() |
603 | 603 |
#temp instantiation of a config writer, used only to get the node list |
604 | 604 |
cfg = config.ConfigWriter() |
605 |
node_list = cfg.GetNodeList()
|
|
605 |
node_names = cfg.GetNodeNames(cfg.GetNodeList())
|
|
606 | 606 |
del cfg |
607 | 607 |
retries = 6 |
608 | 608 |
while retries > 0: |
609 |
votes = bootstrap.GatherMasterVotes(node_list)
|
|
609 |
votes = bootstrap.GatherMasterVotes(node_names)
|
|
610 | 610 |
if not votes: |
611 | 611 |
# empty node list, this is a one node cluster |
612 | 612 |
return True |
... | ... | |
646 | 646 |
master_params = cfg.GetMasterNetworkParameters() |
647 | 647 |
ems = cfg.GetUseExternalMipScript() |
648 | 648 |
runner = rpc.BootstrapRunner() |
649 |
result = runner.call_node_activate_master_ip(master_params.name, |
|
650 |
master_params, ems) |
|
649 |
# we use the node name, as the configuration is only available here yet |
|
650 |
result = runner.call_node_activate_master_ip( |
|
651 |
cfg.GetNodeName(master_params.uuid), master_params, ems) |
|
651 | 652 |
|
652 | 653 |
msg = result.fail_msg |
653 | 654 |
if msg: |
Also available in: Unified diff