Revision 1513e2dd
b/lib/cmdlib.py | ||
---|---|---|
3318 | 3318 |
raise errors.OpPrereqError("Node %s is not in the configuration" % node, |
3319 | 3319 |
errors.ECODE_NOENT) |
3320 | 3320 |
|
3321 |
self.changed_primary_ip = False |
|
3322 |
|
|
3321 | 3323 |
for existing_node_name in node_list: |
3322 | 3324 |
existing_node = cfg.GetNodeInfo(existing_node_name) |
3323 | 3325 |
|
3324 | 3326 |
if self.op.readd and node == existing_node_name: |
3325 |
if (existing_node.primary_ip != primary_ip or |
|
3326 |
existing_node.secondary_ip != secondary_ip): |
|
3327 |
if existing_node.secondary_ip != secondary_ip: |
|
3327 | 3328 |
raise errors.OpPrereqError("Readded node doesn't have the same IP" |
3328 | 3329 |
" address configuration as before", |
3329 | 3330 |
errors.ECODE_INVAL) |
3331 |
if existing_node.primary_ip != primary_ip: |
|
3332 |
self.changed_primary_ip = True |
|
3333 |
|
|
3330 | 3334 |
continue |
3331 | 3335 |
|
3332 | 3336 |
if (existing_node.primary_ip == primary_ip or |
... | ... | |
3398 | 3402 |
self.LogInfo("Readding a node, the offline/drained flags were reset") |
3399 | 3403 |
# if we demote the node, we do cleanup later in the procedure |
3400 | 3404 |
new_node.master_candidate = self.master_candidate |
3405 |
if self.changed_primary_ip: |
|
3406 |
new_node.primary_ip = self.op.primary_ip |
|
3401 | 3407 |
|
3402 | 3408 |
# notify the user about any possible mc promotion |
3403 | 3409 |
if new_node.master_candidate: |
Also available in: Unified diff