[WIP] Fix bootstrap

Change-Id: Icbe6e6f5e8145bb786d4b6aebb804416959cbb67
Signed-off-by: Raphael Lima <Raphael.Lima@windriver.com>
This commit is contained in:
Raphael Lima 2024-05-02 16:47:54 -03:00
parent b4a8ec19dc
commit 5ee0d99e8d
2 changed files with 53 additions and 48 deletions

View File

@ -15,6 +15,7 @@
import os
from cliff import _argparse
from osc_lib.command import command
from dcmanagerclient import exceptions
@ -164,33 +165,35 @@ class SubcloudDeployShow(base.DCManagerShowOne):
class DeprecatedSubcloudDeployShow(SubcloudDeployShow):
def _raise_deprecation_message(self):
deprecation_msg = (
"This command has been deprecated. Please use "
"subcloud deploy show instead."
)
raise exceptions.DCManagerClientException(deprecation_msg)
DEPRECATION_MESSAGE = (
"This command has been deprecated. Please use "
"subcloud deploy show instead."
)
def get_parser(self, _):
self._raise_deprecation_message()
def get_parser(self, prog_name):
parser = _argparse.ArgumentParser(
description=self.DEPRECATION_MESSAGE, add_help=False, usage=prog_name
)
return parser
def _get_resources(self, _):
self._raise_deprecation_message()
raise exceptions.DCManagerClientException(self.DEPRECATION_MESSAGE)
class DeprecatedSubcloudDeployUpload(SubcloudDeployUpload):
def _raise_deprecation_message(self):
deprecation_msg = (
"This command has been deprecated. Please use "
"subcloud deploy upload instead."
)
raise exceptions.DCManagerClientException(deprecation_msg)
DEPRECATION_MESSAGE = (
"This command has been deprecated."
"Please use subcloud deploy upload instead."
)
def get_parser(self, _):
self._raise_deprecation_message()
def get_parser(self, prog_name):
parser = _argparse.ArgumentParser(
description=self.DEPRECATION_MESSAGE, add_help=False, usage=prog_name
)
return parser
def _get_resources(self, _):
self._raise_deprecation_message()
raise exceptions.DCManagerClientException(self.DEPRECATION_MESSAGE)
class SubcloudDeployDelete(command.Command):

View File

@ -17,6 +17,7 @@
import base64
import os
from cliff import _argparse
from osc_lib.command import command
import six
@ -750,41 +751,40 @@ class UpdateSubcloud(base.DCManagerShowOne):
class ReconfigSubcloud(base.DCManagerShowOne):
"""Reconfigure a subcloud."""
def _raise_deprecation_message(self):
deprecation_msg = (
"This command has been deprecated. Please use "
"'subcloud deploy config' instead."
)
raise exceptions.DCManagerClientException(deprecation_msg)
DEPRECATION_MESSAGE = (
"This command has been deprecated. Please use "
"subcloud deploy config' instead."
)
def _get_format_function(self):
return detail_format
def get_parser(self, _):
self._raise_deprecation_message()
def get_parser(self, prog_name):
parser = _argparse.ArgumentParser(
description=self.DEPRECATION_MESSAGE, add_help=False, usage=prog_name
)
return parser
def _get_resources(self, _):
self._raise_deprecation_message()
raise exceptions.DCManagerClientException(self.DEPRECATION_MESSAGE)
class ReinstallSubcloud(base.DCManagerShowOne):
"""Reinstall a subcloud."""
def _raise_deprecation_message(self):
deprecation_msg = (
"This command has been deprecated. Please use "
"'subcloud redeploy' instead."
DEPRECATION_MESSAGE = (
"This command has been deprecated. Please use "
"'subcloud redeploy' instead."
)
def get_parser(self, prog_name):
parser = _argparse.ArgumentParser(
description=self.DEPRECATION_MESSAGE, add_help=False, usage=prog_name
)
raise exceptions.DCManagerClientException(deprecation_msg)
def _get_format_function(self):
return detail_format
def get_parser(self, _):
self._raise_deprecation_message()
return parser
def _get_resources(self, _):
self._raise_deprecation_message()
raise exceptions.DCManagerClientException(self.DEPRECATION_MESSAGE)
class RedeploySubcloud(base.DCManagerShowOne):
@ -925,21 +925,22 @@ class RedeploySubcloud(base.DCManagerShowOne):
class RestoreSubcloud(base.DCManagerShowOne):
"""Restore a subcloud."""
def _raise_deprecation_message(self):
deprecation_msg = (
"This command has been deprecated. Please use "
"subcloud-backup restore instead."
)
raise exceptions.DCManagerClientException(deprecation_msg)
DEPRECATION_MESSAGE = (
"This command has been deprecated. Please use "
"subcloud-backup restore instead."
)
def _get_format_function(self):
return detail_format
def get_parser(self, _):
self._raise_deprecation_message()
def get_parser(self, prog_name):
parser = _argparse.ArgumentParser(
description=self.DEPRECATION_MESSAGE, add_help=False, usage=prog_name
)
return parser
def _get_resources(self, _):
self._raise_deprecation_message()
raise exceptions.DCManagerClientException(self.DEPRECATION_MESSAGE)
class PrestageSubcloud(base.DCManagerShowOne):
@ -1011,3 +1012,4 @@ class PrestageSubcloud(base.DCManagerShowOne):
print(exc)
error_msg = f"Unable to prestage subcloud {subcloud_ref}"
raise exceptions.DCManagerClientException(error_msg)