Merge "Use "via" in gateway dictionary in Linux Bridge agent"
This commit is contained in:
commit
33919fbd50
|
@ -1508,7 +1508,7 @@ def list_ip_routes(namespace, ip_version, scope=None, via=None, table=None,
|
|||
'scope': IP_ADDRESS_SCOPE[int(route['scope'])],
|
||||
'device': get_device(int(get_attr(route, 'RTA_OIF')), devices),
|
||||
'via': get_attr(route, 'RTA_GATEWAY'),
|
||||
'priority': get_attr(route, 'RTA_PRIORITY'),
|
||||
'metric': get_attr(route, 'RTA_PRIORITY'),
|
||||
}
|
||||
|
||||
ret.append(value)
|
||||
|
|
|
@ -399,9 +399,9 @@ class LinuxBridgeManager(amb.CommonAgentManagerBase):
|
|||
metric = 100
|
||||
if 'metric' in gateway:
|
||||
metric = gateway['metric'] - 1
|
||||
dst_device.route.add_gateway(gateway=gateway['gateway'],
|
||||
dst_device.route.add_gateway(gateway=gateway['via'],
|
||||
metric=metric)
|
||||
src_device.route.delete_gateway(gateway=gateway['gateway'])
|
||||
src_device.route.delete_gateway(gateway=gateway['via'])
|
||||
|
||||
# Remove IP's from interface
|
||||
if ips:
|
||||
|
|
|
@ -323,10 +323,10 @@ class IpLibTestCase(IpLibTestFramework):
|
|||
}
|
||||
expected_gateways = {
|
||||
constants.IP_VERSION_4: {
|
||||
'priority': metric,
|
||||
'metric': metric,
|
||||
'via': gateways[constants.IP_VERSION_4]},
|
||||
constants.IP_VERSION_6: {
|
||||
'priority': metric,
|
||||
'metric': metric,
|
||||
'via': gateways[constants.IP_VERSION_6]}}
|
||||
|
||||
for ip_version, gateway_ip in gateways.items():
|
||||
|
@ -876,7 +876,7 @@ class IpRouteCommandTestCase(functional_base.BaseSudoTestCase):
|
|||
'scope': scope,
|
||||
'device': 'test_device',
|
||||
'via': via,
|
||||
'priority': metric}
|
||||
'metric': metric}
|
||||
try:
|
||||
utils.wait_until_true(fn, timeout=5)
|
||||
except utils.WaitTimeout:
|
||||
|
|
|
@ -471,7 +471,7 @@ class TestLinuxBridgeManager(base.BaseTestCase):
|
|||
dv6_fn.assert_not_called()
|
||||
|
||||
def test__update_interface_ip_details(self):
|
||||
gwdict = dict(gateway='1.1.1.1',
|
||||
gwdict = dict(via='1.1.1.1',
|
||||
metric=50)
|
||||
ipdict = dict(cidr='1.1.1.1/24',
|
||||
broadcast='1.1.1.255',
|
||||
|
|
Loading…
Reference in New Issue