Merge "Removing deprecated arguments for node delete"

This commit is contained in:
Zuul 2021-01-25 21:23:35 +00:00 committed by Gerrit Code Review
commit 9e69c98d03
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

@ -71,8 +71,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'])
@ -83,8 +83,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'])
@ -99,8 +99,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', ])
@ -183,9 +182,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>',