Merge "Remove deprecated option"
This commit is contained in:
@@ -69,17 +69,6 @@ class CreateBaremetalPort(command.ShowOne):
|
|||||||
"the required keys are 'port_id' and 'hostname'. "
|
"the required keys are 'port_id' and 'hostname'. "
|
||||||
"Argument can be specified multiple times.")
|
"Argument can be specified multiple times.")
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
|
||||||
'-l',
|
|
||||||
dest='local_link_connection_deprecated',
|
|
||||||
metavar="<key=value>",
|
|
||||||
action='append',
|
|
||||||
help=_("DEPRECATED. Please use --local-link-connection instead. "
|
|
||||||
"Key/value metadata describing Local link connection "
|
|
||||||
"information. Valid keys are 'switch_info', 'switch_id', "
|
|
||||||
"and 'port_id'. The keys 'switch_id' and 'port_id' are "
|
|
||||||
"required. Can be specified multiple times.")
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'--pxe-enabled',
|
'--pxe-enabled',
|
||||||
metavar='<boolean>',
|
metavar='<boolean>',
|
||||||
@@ -124,18 +113,6 @@ class CreateBaremetalPort(command.ShowOne):
|
|||||||
self.log.debug("take_action(%s)", parsed_args)
|
self.log.debug("take_action(%s)", parsed_args)
|
||||||
baremetal_client = self.app.client_manager.baremetal
|
baremetal_client = self.app.client_manager.baremetal
|
||||||
|
|
||||||
if parsed_args.local_link_connection_deprecated:
|
|
||||||
self.log.warning("Please use --local-link-connection instead "
|
|
||||||
"of -l, as it is deprecated and will be "
|
|
||||||
"removed in future releases.")
|
|
||||||
# It is parsed to either None, or to an array
|
|
||||||
if parsed_args.local_link_connection:
|
|
||||||
parsed_args.local_link_connection.extend(
|
|
||||||
parsed_args.local_link_connection_deprecated)
|
|
||||||
else:
|
|
||||||
parsed_args.local_link_connection = (
|
|
||||||
parsed_args.local_link_connection_deprecated)
|
|
||||||
|
|
||||||
field_list = ['address', 'uuid', 'extra', 'node_uuid', 'pxe_enabled',
|
field_list = ['address', 'uuid', 'extra', 'node_uuid', 'pxe_enabled',
|
||||||
'local_link_connection', 'portgroup_uuid',
|
'local_link_connection', 'portgroup_uuid',
|
||||||
'physical_network', 'name', 'description']
|
'physical_network', 'name', 'description']
|
||||||
|
|||||||
@@ -180,24 +180,6 @@ class TestCreateBaremetalPort(TestBaremetalPort):
|
|||||||
self.baremetal_mock.port.create.assert_called_once_with(**args)
|
self.baremetal_mock.port.create.assert_called_once_with(**args)
|
||||||
self.cmd.log.warning.assert_called()
|
self.cmd.log.warning.assert_called()
|
||||||
|
|
||||||
def test_baremetal_port_create_llc_warning_some_deprecated(self):
|
|
||||||
self._test_baremetal_port_create_llc_warning(
|
|
||||||
additional_args=['-l', 'port_id=eth0', '--local-link-connection',
|
|
||||||
'switch_id=aa:bb:cc:dd:ee:ff'],
|
|
||||||
additional_verify_items=[
|
|
||||||
('local_link_connection_deprecated', ['port_id=eth0']),
|
|
||||||
('local_link_connection', ['switch_id=aa:bb:cc:dd:ee:ff'])]
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_baremetal_port_create_llc_warning_all_deprecated(self):
|
|
||||||
self._test_baremetal_port_create_llc_warning(
|
|
||||||
additional_args=['-l', 'port_id=eth0', '-l',
|
|
||||||
'switch_id=aa:bb:cc:dd:ee:ff'],
|
|
||||||
additional_verify_items=[('local_link_connection_deprecated',
|
|
||||||
['port_id=eth0',
|
|
||||||
'switch_id=aa:bb:cc:dd:ee:ff'])]
|
|
||||||
)
|
|
||||||
|
|
||||||
def test_baremetal_port_create_portgroup_uuid(self):
|
def test_baremetal_port_create_portgroup_uuid(self):
|
||||||
arglist = [
|
arglist = [
|
||||||
baremetal_fakes.baremetal_port_address,
|
baremetal_fakes.baremetal_port_address,
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The deprecated ``-l`` option of ``openstack baremetal port create`` command
|
||||||
|
was removed. Use the ``--local-link-connection`` option istead.
|
||||||
Reference in New Issue
Block a user