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 <hugo.brito@windriver.com>
This commit is contained in:
Hugo Brito 2024-09-17 15:36:20 -03:00
parent ec372f6ef7
commit cce5bf8d9a

View File

@ -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):