pre bootstrap deploy patch

Patch deployment for pre bootstrap case was running into issues
due to sysinv calls made and controller-0 checks, they are now
called only when its not a pre bootstrap case.

Test Plan
PASS: Run patch deployment lifecycle for pre bootstrap
      case
PASS: Run patch deployment lifecycle for bootstrap case
PASS: Run major release deployment lifecycle for bootstrap
      case

Story: 2010676
Task: 51149
Change-Id: Ia575c512026b0b2cf1fefaef867b5efbabc7af90
Signed-off-by: sshathee <shunmugam.shatheesh@windriver.com>
This commit is contained in:
sshathee 2024-10-09 11:03:12 -04:00
parent 5d18eba713
commit d00ee68433

View File

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