Exclude patching ops from major release deploy

In a pre-patched iso, the metadata file comes with the latest patch may
contain patching specific pre and post install scripts. However the
scripts are not accessible as part of the pre-patched iso.

This change is to exclude copying pre-install and post-install scripts
for patching deploy from being applied to major release deploy.

Story: 2010676
Task: 51157

TCs:
    passed: complete SX upgrade to a pre-patched iso

Change-Id: I0fb6378609c6f371483c4fd8547e3eda202bc65b
Signed-off-by: Bin Qian <bin.qian@windriver.com>
This commit is contained in:
Bin Qian 2024-10-10 04:18:53 +00:00 committed by Bin Qian
parent 8dacb327c9
commit 14d6d356b0

View File

@ -3749,6 +3749,7 @@ class PatchController(PatchService):
if not self.hosts[ip].is_alive:
raise HostAgentUnreachable(hostname)
is_major_release = self.check_upgrade_in_progress()
deploy_host = self.db_api_instance.get_deploy_host_by_hostname(hostname)
if deploy_host is None:
raise HostNotFound(hostname)
@ -3757,7 +3758,7 @@ class PatchController(PatchService):
if not self.install_local:
deploy_host_validations(
hostname,
is_major_release=self.check_upgrade_in_progress(),
is_major_release=is_major_release,
rollback=rollback
)
deploy_state = DeployState.get_instance()
@ -3777,7 +3778,7 @@ class PatchController(PatchService):
LOG.info(msg)
audit_log_info(msg)
if self.allow_insvc_patching:
if not is_major_release and self.allow_insvc_patching:
LOG.info("Allowing in-service patching")
force = True
self.copy_install_scripts()
@ -3785,7 +3786,7 @@ class PatchController(PatchService):
# Check if there is a major release deployment in progress
# and set agent request parameters accordingly
major_release = None
if self.check_upgrade_in_progress():
if is_major_release:
upgrade_release = self.get_software_upgrade()
major_release = upgrade_release["to_release"]
force = False