Merge "Add 'baremetal' as an allowed vnic type"

This commit is contained in:
Jenkins 2015-11-30 18:32:05 +00:00 committed by Gerrit Code Review
commit 13b95c83ed
2 changed files with 23 additions and 3 deletions

View File

@ -239,12 +239,12 @@ class CreatePort(neutronV20.CreateCommand, UpdatePortSecGroupMixin,
'--mac_address',
help=argparse.SUPPRESS)
parser.add_argument(
'--vnic-type', metavar='<direct | macvtap | normal>',
choices=['direct', 'macvtap', 'normal'],
'--vnic-type', metavar='<direct | macvtap | normal | baremetal>',
choices=['direct', 'macvtap', 'normal', 'baremetal'],
help=_('VNIC type for this port.'))
parser.add_argument(
'--vnic_type',
choices=['direct', 'macvtap', 'normal'],
choices=['direct', 'macvtap', 'normal', 'baremetal'],
help=argparse.SUPPRESS)
parser.add_argument(
'--binding-profile',

View File

@ -173,6 +173,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_baremetal(self):
"""Create port: --vnic_type baremetal netid."""
resource = 'port'
cmd = port.CreatePort(test_cli20.MyApp(sys.stdout), None)
name = 'myname'
myid = 'myid'
netid = 'netid'
args = ['--vnic_type', 'baremetal', netid]
position_names = ['binding:vnic_type', 'network_id']
position_values = ['baremetal', netid]
self._test_create_resource(resource, cmd, name, myid, args,
position_names, position_values)
# Test dashed options
args = ['--vnic-type', 'baremetal', netid]
position_names = ['binding:vnic_type', 'network_id']
position_values = ['baremetal', netid]
self._test_create_resource(resource, cmd, name, myid, args,
position_names, position_values)
def test_create_port_with_binding_profile(self):
resource = 'port'
cmd = port.CreatePort(test_cli20.MyApp(sys.stdout), None)