Revision 35c0c8da
b/lib/backend.py | ||
---|---|---|
574 | 574 |
@return: C{True} if all of them exist, C{False} otherwise |
575 | 575 |
|
576 | 576 |
""" |
577 |
missing = [] |
|
577 | 578 |
for bridge in bridges_list: |
578 | 579 |
if not utils.BridgeExists(bridge): |
579 |
return False
|
|
580 |
missing.append(bridge)
|
|
580 | 581 |
|
581 |
return True |
|
582 |
if missing: |
|
583 |
return False, "Missing bridges %s" % (", ".join(missing),) |
|
584 |
|
|
585 |
return True, None |
|
582 | 586 |
|
583 | 587 |
|
584 | 588 |
def GetInstanceList(hypervisor_list): |
b/lib/cmdlib.py | ||
---|---|---|
610 | 610 |
if params[constants.NIC_MODE] == constants.NIC_MODE_BRIDGED] |
611 | 611 |
if brlist: |
612 | 612 |
result = lu.rpc.call_bridges_exist(target_node, brlist) |
613 |
result.Raise() |
|
614 |
if not result.data: |
|
615 |
raise errors.OpPrereqError("One or more target bridges %s does not" |
|
616 |
" exist on destination node '%s'" % |
|
617 |
(brlist, target_node)) |
|
613 |
msg = result.RemoteFailMsg() |
|
614 |
if msg: |
|
615 |
raise errors.OpPrereqError("Error checking bridges on destination node" |
|
616 |
" '%s': %s" % (target_node, msg)) |
|
618 | 617 |
|
619 | 618 |
|
620 | 619 |
def _CheckInstanceBridgesExist(lu, instance, node=None): |
... | ... | |
6166 | 6165 |
if new_nic_mode == constants.NIC_MODE_BRIDGED: |
6167 | 6166 |
nic_bridge = new_filled_nic_params[constants.NIC_LINK] |
6168 | 6167 |
result = self.rpc.call_bridges_exist(pnode, [nic_bridge]) |
6169 |
result.Raise() |
|
6170 |
if not result.data: |
|
6171 |
msg = ("Bridge '%s' doesn't exist on one of" |
|
6172 |
" the instance nodes" % nic_bridge) |
|
6168 |
msg = result.RemoteFailMsg() |
|
6169 |
if msg: |
|
6170 |
msg = "Error checking bridges on node %s: %s" % (pnode, msg) |
|
6173 | 6171 |
if self.force: |
6174 | 6172 |
self.warn.append(msg) |
6175 | 6173 |
else: |
Also available in: Unified diff