Merge "Fix the wrong dest of 'vlan' option and add new 'vlan_start' option"
This commit is contained in:
commit
711326a834
novaclient
@ -57,6 +57,7 @@ class NetworksTest(utils.FixturedTestCase):
|
||||
'multi_host': 'T',
|
||||
'priority': '1',
|
||||
'project_id': '1',
|
||||
'vlan': 5,
|
||||
'vlan_start': 1,
|
||||
'vpn_start': 1
|
||||
}
|
||||
|
@ -1757,7 +1757,14 @@ class ShellTest(utils.TestCase):
|
||||
self.run_command('network-create --fixed-range-v4 192.168.0.0/24'
|
||||
' --vlan=200 new_network')
|
||||
body = {'network': {'cidr': '192.168.0.0/24', 'label': 'new_network',
|
||||
'vlan_start': '200'}}
|
||||
'vlan': '200'}}
|
||||
self.assert_called('POST', '/os-networks', body)
|
||||
|
||||
def test_network_create_vlan_start(self):
|
||||
self.run_command('network-create --fixed-range-v4 192.168.0.0/24'
|
||||
' --vlan-start=100 new_network')
|
||||
body = {'network': {'cidr': '192.168.0.0/24', 'label': 'new_network',
|
||||
'vlan_start': '100'}}
|
||||
self.assert_called('POST', '/os-networks', body)
|
||||
|
||||
def test_add_fixed_ip(self):
|
||||
|
@ -86,6 +86,7 @@ class NetworkManager(base.ManagerWithFind):
|
||||
:param multi_host: str
|
||||
:param priority: str
|
||||
:param project_id: str
|
||||
:param vlan: int
|
||||
:param vlan_start: int
|
||||
:param vpn_start: int
|
||||
|
||||
|
@ -844,7 +844,7 @@ def _filter_network_create_options(args):
|
||||
valid_args = ['label', 'cidr', 'vlan_start', 'vpn_start', 'cidr_v6',
|
||||
'gateway', 'gateway_v6', 'bridge', 'bridge_interface',
|
||||
'multi_host', 'dns1', 'dns2', 'uuid', 'fixed_cidr',
|
||||
'project_id', 'priority']
|
||||
'project_id', 'priority', 'vlan']
|
||||
kwargs = {}
|
||||
for k, v in args.__dict__.items():
|
||||
if k in valid_args and v is not None:
|
||||
@ -864,9 +864,14 @@ def _filter_network_create_options(args):
|
||||
dest="cidr_v6",
|
||||
help=_('IPv6 subnet (ex: fe80::/64'))
|
||||
@utils.arg('--vlan',
|
||||
dest='vlan_start',
|
||||
dest='vlan',
|
||||
metavar='<vlan id>',
|
||||
help=_("vlan id"))
|
||||
help=_("vlan id to be assigned to project"))
|
||||
@utils.arg('--vlan-start',
|
||||
dest='vlan_start',
|
||||
metavar='<vlan start>',
|
||||
help=_('First vlan ID to be assigned to project. Subsequent vlan'
|
||||
' IDs will be assigned incrementally'))
|
||||
@utils.arg('--vpn',
|
||||
dest='vpn_start',
|
||||
metavar='<vpn start>',
|
||||
|
Loading…
x
Reference in New Issue
Block a user