summaryrefslogtreecommitdiff
path: root/neutronclient
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-01-08 12:34:04 +0000
committerGerrit Code Review <review@openstack.org>2016-01-08 12:34:04 +0000
commit980ff3866c955661c8d99d243b27f1bc9273f650 (patch)
treefe882459edcad64849b2cca01a7544d938c40695 /neutronclient
parent8105a787a28e29db86ca80d5929a0e7f391d339f (diff)
parent199cb1e4f857d7ed65142af05eb0de2876eaaea4 (diff)
downloadpython-neutronclient-4.0.0.tar.gz
Merge "port: Add 'direct-physical' as a valid vnic-type"4.0.0
Diffstat (limited to 'neutronclient')
-rw-r--r--neutronclient/neutron/v2_0/port.py10
-rw-r--r--neutronclient/tests/unit/test_cli20_port.py20
2 files changed, 27 insertions, 3 deletions
diff --git a/neutronclient/neutron/v2_0/port.py b/neutronclient/neutron/v2_0/port.py
index c611d26..719d4ad 100644
--- a/neutronclient/neutron/v2_0/port.py
+++ b/neutronclient/neutron/v2_0/port.py
@@ -238,12 +238,16 @@ class CreatePort(neutronV20.CreateCommand, UpdatePortSecGroupMixin,
'--mac_address',
help=argparse.SUPPRESS)
parser.add_argument(
- '--vnic-type', metavar='<direct | macvtap | normal | baremetal>',
- choices=['direct', 'macvtap', 'normal', 'baremetal'],
+ '--vnic-type',
+ metavar='<direct | direct-physical | macvtap '
+ '| normal | baremetal>',
+ choices=['direct', 'direct-physical', 'macvtap',
+ 'normal', 'baremetal'],
help=_('VNIC type for this port.'))
parser.add_argument(
'--vnic_type',
- choices=['direct', 'macvtap', 'normal', 'baremetal'],
+ choices=['direct', 'direct-physical', 'macvtap',
+ 'normal', 'baremetal'],
help=argparse.SUPPRESS)
parser.add_argument(
'--binding-profile',
diff --git a/neutronclient/tests/unit/test_cli20_port.py b/neutronclient/tests/unit/test_cli20_port.py
index de21976..4b6d617 100644
--- a/neutronclient/tests/unit/test_cli20_port.py
+++ b/neutronclient/tests/unit/test_cli20_port.py
@@ -153,6 +153,26 @@ class CLITestV20PortJSON(test_cli20.CLITestV20Base):
self._test_create_resource(resource, cmd, name, myid, args,
position_names, position_values)
+ def test_create_port_vnic_type_direct_physical(self):
+ # Create port: --vnic_type direct-physical netid.
+ resource = 'port'
+ cmd = port.CreatePort(test_cli20.MyApp(sys.stdout), None)
+ name = 'myname'
+ myid = 'myid'
+ netid = 'netid'
+ args = ['--vnic_type', 'direct-physical', netid]
+ position_names = ['binding:vnic_type', 'network_id']
+ position_values = ['direct-physical', netid]
+ self._test_create_resource(resource, cmd, name, myid, args,
+ position_names, position_values)
+
+ # Test dashed options
+ args = ['--vnic-type', 'direct-physical', netid]
+ position_names = ['binding:vnic_type', 'network_id']
+ position_values = ['direct-physical', netid]
+ self._test_create_resource(resource, cmd, name, myid, args,
+ position_names, position_values)
+
def test_create_port_vnic_type_macvtap(self):
# Create port: --vnic_type macvtap netid.
resource = 'port'