Merge "port: Add 'direct-physical' as a valid vnic-type"

This commit is contained in:
Jenkins 2016-01-08 12:34:04 +00:00 committed by Gerrit Code Review
commit 980ff3866c
3 changed files with 33 additions and 3 deletions

View File

@ -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',

View File

@ -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'

View File

@ -0,0 +1,6 @@
---
features:
- Added new 'direct-physical' vnic-type option for port-create CLI command.
Passing this particular value allows for a port to be create with the
vnic-type used for assigning SR-IOV physical functions to
instances.