From cce5bf8d9abc5acbda0da71394ad703090a48bde Mon Sep 17 00:00:00 2001 From: Hugo Brito Date: Tue, 17 Sep 2024 15:36:20 -0300 Subject: [PATCH] Skip check_license for PatchHealthCheck This change updates the PatchHealthCheck logic to skip the license validation step when deploying a minor release (patch). License checks are only necessary during major releases (upgrade), so the software deploy precheck script for sw-deploy now skips the license check for patches releases, optimizing the process and avoiding unnecessary validations. Test Plan: PASS: Verify that the license check is skipped when deploying a patch release. PASS: Verify that the license check runs correctly during major releases. PASS: Perform a full patch release. Story: 2010676 Task: 51032 Change-Id: I079ca5bfd3ab6ed66290e5bea99fb27692dabc91 Signed-off-by: Hugo Brito --- software/scripts/deploy-precheck | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/software/scripts/deploy-precheck b/software/scripts/deploy-precheck index 07ce7ed5..bffabae5 100644 --- a/software/scripts/deploy-precheck +++ b/software/scripts/deploy-precheck @@ -146,12 +146,6 @@ class HealthCheck(object): success = False health_ok = health_ok and success - # check installed license - success = self._check_license(self._major_release) - output += 'Installed license is valid: [%s]\n' \ - % (HealthCheck.SUCCESS_MSG if success else HealthCheck.FAIL_MSG) - health_ok = health_ok and success - return health_ok, output @@ -259,6 +253,13 @@ class UpgradeHealthCheck(HealthCheck): % (HealthCheck.SUCCESS_MSG if success else HealthCheck.FAIL_MSG) health_ok = health_ok and success + # check installed license + # NOTE(nicodemos): We just need to check the license for major release + success = self._check_license(self._major_release) + output += 'Installed license is valid: [%s]\n' \ + % (HealthCheck.SUCCESS_MSG if success else HealthCheck.FAIL_MSG) + health_ok = health_ok and success + return health_ok, output def run_health_check_in_from_release(self):