From 2b7efc3eea4df427b9fa4753280018e35da679fe Mon Sep 17 00:00:00 2001 From: Gustavo Herzmann Date: Thu, 18 May 2023 15:59:17 -0300 Subject: [PATCH] Rename dcmanager subcloud-deploy commands Renames the 'dcmanager subcloud-deploy upload/show' commands to 'dcmanager subcloud deploy upload/show'. This is done so that the command names are consistent with the new 'dcmanager subcloud deploy' commands (add, install, bootstrap, config, abort and resume). The original commands will return a deprecation notice, instructing the user to use the new command names. Test Plan: 1. PASS - Verify that both renamed commands are working as expected (no change to the command functionality); 2. PASS - Verify that the old commands are returning the deprecation notice instructing the user to use the renamed commands; 3. PASS - Verify that the return code when using the deprecated commands is 1; 4. PASS - Verify that the 'dcmanager help' shows the correct help message for the renamed commands. Story: 2010756 Task: 48054 Change-Id: I731b49d74b8d05b411030e3ed83dbc0266df9d9b Signed-off-by: Gustavo Herzmann --- .../commands/v1/subcloud_deploy_manager.py | 14 ++++++++++++++ distributedcloud-client/dcmanagerclient/shell.py | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/distributedcloud-client/dcmanagerclient/commands/v1/subcloud_deploy_manager.py b/distributedcloud-client/dcmanagerclient/commands/v1/subcloud_deploy_manager.py index 0140a20..d1b41a0 100644 --- a/distributedcloud-client/dcmanagerclient/commands/v1/subcloud_deploy_manager.py +++ b/distributedcloud-client/dcmanagerclient/commands/v1/subcloud_deploy_manager.py @@ -160,3 +160,17 @@ class SubcloudDeployShow(base.DCManagerShowOne): dcmanager_client = self.app.client_manager.subcloud_deploy_manager return dcmanager_client.subcloud_deploy_manager.subcloud_deploy_show( parsed_args.release) + + +class DeprecatedSubcloudDeployShow(SubcloudDeployShow): + def _get_resources(self, parsed_args): + deprecation_msg = ('This command has been deprecated. Please use ' + 'subcloud deploy show instead.') + raise exceptions.DCManagerClientException(deprecation_msg) + + +class DeprecatedSubcloudDeployUpload(SubcloudDeployUpload): + def _get_resources(self, parsed_args): + deprecation_msg = ('This command has been deprecated. Please use ' + 'subcloud deploy upload instead.') + raise exceptions.DCManagerClientException(deprecation_msg) diff --git a/distributedcloud-client/dcmanagerclient/shell.py b/distributedcloud-client/dcmanagerclient/shell.py index fa0ae90..41dfd96 100644 --- a/distributedcloud-client/dcmanagerclient/shell.py +++ b/distributedcloud-client/dcmanagerclient/shell.py @@ -548,8 +548,10 @@ class DCManagerShell(app.App): 'subcloud deploy bootstrap': psdm.BootstrapPhasedSubcloudDeploy, 'subcloud deploy config': psdm.ConfigPhasedSubcloudDeploy, 'subcloud deploy install': psdm.InstallPhasedSubcloudDeploy, - 'subcloud-deploy upload': sdm.SubcloudDeployUpload, - 'subcloud-deploy show': sdm.SubcloudDeployShow, + 'subcloud deploy upload': sdm.SubcloudDeployUpload, + 'subcloud deploy show': sdm.SubcloudDeployShow, + 'subcloud-deploy upload': sdm.DeprecatedSubcloudDeployUpload, + 'subcloud-deploy show': sdm.DeprecatedSubcloudDeployShow, 'alarm summary': am.ListAlarmSummary, 'fw-update-strategy create': fum.CreateFwUpdateStrategy, 'fw-update-strategy delete': fum.DeleteFwUpdateStrategy,