Add 'baremetal' as an allowed vnic type

For wiring up ports for baremetal servers, a new vnic type
of 'baremetal' will be used to allow mechanism drivers to
easily distinguish which ports should contain switch port
information.

This patch adds 'baremetal' as an allowed option on the client.

Change-Id: If25a1af55a3b849227c9145341ae5e3577a5d7fb
Partial-Implements: blueprint neutron-ironic-integration
This commit is contained in:
Kevin Benton
2015-11-23 17:08:42 -08:00
parent 5d5ddba064
commit 0042a39d92
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)