Fix for --bridge-interface being ignore by nova network-create
Change-Id: I84b3264e9cbf78c1af27a3f2fd9690f60f710299 Fixes: bug #1179437
This commit is contained in:
parent
892671173d
commit
e745b4626e
@ -680,8 +680,9 @@ def do_network_associate_project(cs, args):
|
||||
|
||||
def _filter_network_create_options(args):
|
||||
valid_args = ['label', 'cidr', 'vlan_start', 'vpn_start', 'cidr_v6',
|
||||
'gateway', 'gateway_v6', 'bridge', 'multi_host', 'dns1',
|
||||
'dns2', 'uuid', 'fixed_cidr', 'project_id', 'priority']
|
||||
'gateway', 'gateway_v6', 'bridge', 'bridge_interface',
|
||||
'multi_host', 'dns1', 'dns2', 'uuid', 'fixed_cidr',
|
||||
'project_id', 'priority']
|
||||
kwargs = {}
|
||||
for k, v in args.__dict__.items():
|
||||
if k in valid_args and v is not None:
|
||||
|
@ -28,6 +28,29 @@ class NetworksTest(utils.TestCase):
|
||||
{'network': {'label': 'foo'}})
|
||||
self.assertTrue(isinstance(f, networks.Network))
|
||||
|
||||
def test_create_allparams(self):
|
||||
params = {
|
||||
'label': 'bar',
|
||||
'bridge': 'br0',
|
||||
'bridge_interface': 'int0',
|
||||
'cidr': '192.0.2.0/24',
|
||||
'cidr_v6': '2001:DB8::/32',
|
||||
'dns1': '1.1.1.1',
|
||||
'dns2': '1.1.1.2',
|
||||
'fixed_cidr': '198.51.100.0/24',
|
||||
'gateway': '192.0.2.1',
|
||||
'gateway_v6': '2001:DB8::1',
|
||||
'multi_host': 'T',
|
||||
'priority': '1',
|
||||
'project_id': '1',
|
||||
'vlan_start': 1,
|
||||
'vpn_start': 1
|
||||
}
|
||||
|
||||
f = cs.networks.create(**params)
|
||||
cs.assert_called('POST', '/os-networks', {'network': params})
|
||||
self.assertTrue(isinstance(f, networks.Network))
|
||||
|
||||
def test_associate_project(self):
|
||||
cs.networks.associate_project('networktest')
|
||||
cs.assert_called('POST', '/os-networks/add',
|
||||
|
Loading…
Reference in New Issue
Block a user