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 <gustavo.herzmann@windriver.com>
This commit is contained in:
Gustavo Herzmann 2023-05-18 15:59:17 -03:00
parent a45e26cfb7
commit 2b7efc3eea
2 changed files with 18 additions and 2 deletions

View File

@ -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)

View File

@ -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,