Add --force option when managing a subcloud
When managing a subcloud, allow a --force option to be specified. The force option will allow an offline subcloud to be managed. This is necessary in cases where the user has (mistakenly) unmanaged a subcloud that is offline and the subcloud cannot be recovered while it is unmanaged. One example is a failure during DC upgrade orchestration that leaves the subcloud offline. To rerun upgrade orchestration and recover the subcloud, the subcloud must be managed. Story: 2007403 Task: 40467 Change-Id: I0c0fa0f489208c322b463d0c3b889c26575d06f4 Signed-off-by: Tee Ngo <tee.ngo@windriver.com>
This commit is contained in:
parent
b51808f02f
commit
7036f1fd11
|
@ -361,6 +361,14 @@ class ManageSubcloud(base.DCManagerShowOne):
|
||||||
'subcloud',
|
'subcloud',
|
||||||
help='Name or ID of the subcloud to manage.'
|
help='Name or ID of the subcloud to manage.'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--force',
|
||||||
|
required=False,
|
||||||
|
action='store_true',
|
||||||
|
help='Disregard subcloud availability status, intended for \
|
||||||
|
some upgrade recovery scenarios.'
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
def _get_resources(self, parsed_args):
|
def _get_resources(self, parsed_args):
|
||||||
|
@ -368,6 +376,9 @@ class ManageSubcloud(base.DCManagerShowOne):
|
||||||
dcmanager_client = self.app.client_manager.subcloud_manager
|
dcmanager_client = self.app.client_manager.subcloud_manager
|
||||||
kwargs = dict()
|
kwargs = dict()
|
||||||
kwargs['management-state'] = 'managed'
|
kwargs['management-state'] = 'managed'
|
||||||
|
if parsed_args.force:
|
||||||
|
kwargs['force'] = 'true'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return dcmanager_client.subcloud_manager.update_subcloud(
|
return dcmanager_client.subcloud_manager.update_subcloud(
|
||||||
subcloud_ref, files=None, data=kwargs)
|
subcloud_ref, files=None, data=kwargs)
|
||||||
|
|
Loading…
Reference in New Issue