Removing deprecated arguments for node delete

The `-e` and `--templates ` switches have been deprecated for a while, at least
since newton, it's time to remove them because it causes confusion to
operators.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1909347
Change-Id: I4000638be5ec5e95b36e38f1a93ceb5cf2851905
This commit is contained in:
David Vallee Delisle 2020-12-24 00:14:37 -05:00
parent 44b94ee9bf
commit e366699b00
3 changed files with 13 additions and 27 deletions

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Removing the deprecated ``-e`` and ``--templates`` switches to
`overcloud node delete`. This is causing confusion to the operators.

View File

@ -72,8 +72,8 @@ class TestDeleteNode(fakes.TestDeleteNode):
@mock.patch('tripleoclient.utils.run_ansible_playbook',
autospec=True)
def test_node_delete(self, mock_playbook, mock_get_events):
argslist = ['instance1', 'instance2', '--templates',
'--stack', 'overcast', '--timeout', '90', '--yes']
argslist = ['instance1', 'instance2', '--stack', 'overcast',
'--timeout', '90', '--yes']
verifylist = [
('stack', 'overcast'),
('nodes', ['instance1', 'instance2'])
@ -84,8 +84,8 @@ class TestDeleteNode(fakes.TestDeleteNode):
@mock.patch('tripleoclient.utils.prompt_user_for_confirmation',
return_value=False)
def test_node_delete_no_confirm(self, confirm_mock):
argslist = ['instance1', 'instance2', '--templates',
'--stack', 'overcast', '--timeout', '90']
argslist = ['instance1', 'instance2', '--stack', 'overcast',
'--timeout', '90']
verifylist = [
('stack', 'overcast'),
('nodes', ['instance1', 'instance2'])
@ -100,8 +100,7 @@ class TestDeleteNode(fakes.TestDeleteNode):
autospec=True,
side_effect=exceptions.InvalidConfiguration)
def test_node_wrong_stack(self, mock_playbook):
argslist = ['instance1', '--templates',
'--stack', 'overcast', '--yes']
argslist = ['instance1', '--stack', 'overcast', '--yes']
verifylist = [
('stack', 'overcast'),
('nodes', ['instance1', ])
@ -184,9 +183,9 @@ class TestDeleteNode(fakes.TestDeleteNode):
yaml.dump(bm_yaml, inp, encoding='utf-8')
inp.flush()
argslist = ['--baremetal-deployment', inp.name, '--templates',
'--stack', 'overcast', '--overcloud-ssh-port-timeout',
'42', '--timeout', '90', '--yes']
argslist = ['--baremetal-deployment', inp.name, '--stack',
'overcast', '--overcloud-ssh-port-timeout', '42',
'--timeout', '90', '--yes']
verifylist = [
('stack', 'overcast'),
('overcloud_ssh_port_timeout', 42),

View File

@ -57,24 +57,6 @@ class DeleteNode(command.Command):
'(default=Env: OVERCLOUD_STACK_NAME)'),
default=utils.env('OVERCLOUD_STACK_NAME',
default='overcloud'))
parser.add_argument(
'--templates', nargs='?', const=constants.TRIPLEO_HEAT_TEMPLATES,
help=_("The directory containing the Heat templates to deploy. "
"This argument is deprecated. The command now utilizes "
"a deployment plan, which should be updated prior to "
"running this command, should that be required. Otherwise "
"this argument will be silently ignored."),
)
parser.add_argument(
'-e', '--environment-file', metavar='<HEAT ENVIRONMENT FILE>',
action='append', dest='environment_files',
help=_("Environment files to be passed to the heat stack-create "
"or heat stack-update command. (Can be specified more than "
"once.) This argument is deprecated. The command now "
"utilizes a deployment plan, which should be updated prior "
"to running this command, should that be required. "
"Otherwise this argument will be silently ignored."),
)
parser.add_argument(
'--timeout', metavar='<TIMEOUT>',