Merge "pre bootstrap deploy patch"

This commit is contained in:
Zuul 2024-10-10 16:14:11 +00:00 committed by Gerrit Code Review
commit e0591f34e0

View File

@ -3344,6 +3344,7 @@ class PatchController(PatchService):
:return: dict of info, warning and error messages
"""
if not self.pre_bootstrap:
if self.hostname != constants.CONTROLLER_0_HOSTNAME:
raise SoftwareServiceError("Deployment deletion can only be performed on controller-0.")
@ -3361,6 +3362,7 @@ class PatchController(PatchService):
# hosts must be unlocked and online since during delete deployment
# a request is sent to all hosts to clear flags and temporary data
# created during the deployment procedure
if not self.pre_bootstrap:
if (deploy_state_instance.get_deploy_state() not in [DEPLOY_STATES.START_DONE,
DEPLOY_STATES.START_FAILED] and
not are_all_hosts_unlocked_and_online()):
@ -3541,6 +3543,7 @@ class PatchController(PatchService):
return True
def _check_pre_activate(self):
if not self.pre_bootstrap:
if not are_all_hosts_unlocked_and_online():
msg = f"Hosts must be {constants.ADMIN_UNLOCKED} and {constants.AVAILABILITY_ONLINE}."
raise SoftwareServiceError(error=msg)