diff --git a/novaclient/v1_1/shell.py b/novaclient/v1_1/shell.py index 4a0194c6e..ed7f8aa6d 100644 --- a/novaclient/v1_1/shell.py +++ b/novaclient/v1_1/shell.py @@ -632,9 +632,9 @@ def do_network_associate_project(cs, args): def _filter_network_create_options(args): - valid_args = ['label', 'cidr', 'vlan', 'vpn_start', 'cidr_v6', 'gateway', - 'gateway_v6', 'bridge', 'multi_host', 'dns1', 'dns2', 'uuid', - 'fixed_cidr', 'project_id', 'priority'] + valid_args = ['label', 'cidr', 'vlan_start', 'vpn_start', 'cidr_v6', + 'gateway', 'gateway_v6', 'bridge', '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: @@ -654,7 +654,7 @@ def _filter_network_create_options(args): dest="cidr_v6", help='IPv6 subnet (ex: fe80::/64') @utils.arg('--vlan', - dest='vlan', + dest='vlan_start', metavar='<vlan id>', help="vlan id") @utils.arg('--vpn', diff --git a/tests/v1_1/test_shell.py b/tests/v1_1/test_shell.py index bf5c812e0..b157dc44b 100644 --- a/tests/v1_1/test_shell.py +++ b/tests/v1_1/test_shell.py @@ -1113,6 +1113,13 @@ class ShellTest(utils.TestCase): 'multi_host': False}} self.assert_called('POST', '/os-networks', body) + def test_network_create_vlan(self): + 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'}} + self.assert_called('POST', '/os-networks', body) + def test_add_fixed_ip(self): self.run_command('add-fixed-ip sample-server 1') self.assert_called('POST', '/servers/1234/action',