From e366699b0017c79c6865252ae1ae01df5d6301df Mon Sep 17 00:00:00 2001 From: David Vallee Delisle Date: Thu, 24 Dec 2020 00:14:37 -0500 Subject: [PATCH] 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 --- ...e-deprecated-switches-299df71bf6dfe450.yaml | 5 +++++ .../v1/overcloud_node/test_overcloud_node.py | 17 ++++++++--------- tripleoclient/v1/overcloud_node.py | 18 ------------------ 3 files changed, 13 insertions(+), 27 deletions(-) create mode 100644 releasenotes/notes/remove-node-delete-deprecated-switches-299df71bf6dfe450.yaml diff --git a/releasenotes/notes/remove-node-delete-deprecated-switches-299df71bf6dfe450.yaml b/releasenotes/notes/remove-node-delete-deprecated-switches-299df71bf6dfe450.yaml new file mode 100644 index 000000000..c75b3d98c --- /dev/null +++ b/releasenotes/notes/remove-node-delete-deprecated-switches-299df71bf6dfe450.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Removing the deprecated ``-e`` and ``--templates`` switches to + `overcloud node delete`. This is causing confusion to the operators. diff --git a/tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py b/tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py index 654e91add..c37a9d2e0 100644 --- a/tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py +++ b/tripleoclient/tests/v1/overcloud_node/test_overcloud_node.py @@ -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), diff --git a/tripleoclient/v1/overcloud_node.py b/tripleoclient/v1/overcloud_node.py index afe498756..d2502a43d 100644 --- a/tripleoclient/v1/overcloud_node.py +++ b/tripleoclient/v1/overcloud_node.py @@ -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='', - 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='',