Commit 3f3b6e7d authored by Petr Pudlak's avatar Petr Pudlak
Browse files

Fix calls to Update in LUNodeSetParams



Add calls to Update after modifying the node's configuration and move
some of the modifications so that they don't conflict with other calls
to ConfigWriter.
Signed-off-by: default avatarPetr Pudlak <pudlak@google.com>
Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
parent 66223061
......@@ -763,6 +763,13 @@ class LUNodeSetParams(LogicalUnit):
setattr(node, attr, val)
result.append((attr, str(val)))
if self.op.secondary_ip:
node.secondary_ip = self.op.secondary_ip
result.append(("secondary_ip", self.op.secondary_ip))
# this will trigger configuration file update, if needed
self.cfg.Update(node, feedback_fn)
if self.new_role != self.old_role:
# Tell the node to demote itself, if no longer MC and not offline
if self.old_role == self._ROLE_CANDIDATE and \
......@@ -776,6 +783,7 @@ class LUNodeSetParams(LogicalUnit):
if of != nf:
result.append((desc, str(nf)))
(node.master_candidate, node.drained, node.offline) = new_flags
self.cfg.Update(node, feedback_fn)
# we locked all nodes, we adjust the CP before updating this node
if self.lock_all:
......@@ -788,13 +796,6 @@ class LUNodeSetParams(LogicalUnit):
if self.old_role == self._ROLE_CANDIDATE:
RemoveNodeCertFromCandidateCerts(self.cfg, node.uuid)
if self.op.secondary_ip:
node.secondary_ip = self.op.secondary_ip
result.append(("secondary_ip", self.op.secondary_ip))
# this will trigger configuration file update, if needed
self.cfg.Update(node, feedback_fn)
# this will trigger job queue propagation or cleanup if the mc
# flag changed
if [self.old_role, self.new_role].count(self._ROLE_CANDIDATE) == 1:
......
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