From 14d6d356b0c8101b4464c153d1d2e8098851f071 Mon Sep 17 00:00:00 2001 From: Bin Qian Date: Thu, 10 Oct 2024 04:18:53 +0000 Subject: [PATCH] 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 --- software/software/software_controller.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/software/software/software_controller.py b/software/software/software_controller.py index 8b608c1a..b14ee15f 100644 --- a/software/software/software_controller.py +++ b/software/software/software_controller.py @@ -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