Commit 212a7fcd authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Check BGL when adding/removing node


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent f7d9b3aa
......@@ -4436,6 +4436,9 @@ class LUNodeRemove(LogicalUnit):
modify_ssh_setup = self.cfg.GetClusterInfo().modify_ssh_setup
assert locking.BGL in self.owned_locks(locking.LEVEL_CLUSTER), \
"Not owning BGL"
# Promote nodes to master candidate as needed
_AdjustCandidatePool(self, exceptions=[node.name])
self.context.RemoveNode(node.name)
......@@ -5102,6 +5105,9 @@ class LUNodeAdd(LogicalUnit):
new_node = self.new_node
node = new_node.name
assert locking.BGL in self.owned_locks(locking.LEVEL_CLUSTER), \
"Not owning BGL"
# We adding a new node so we assume it's powered
new_node.powered = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment