Update references to appframework lifecycle constants.

The application framework lifecycle constants were split into two
files, sysinv/helm/lifecycle_constants.py and sysinv/common/constants.py.
Aiming to facilitate the split of the application framework into a
separate application in the future, the review: https://review.opendev.org/c/starlingx/config/+/936252
moved the lifecycle variables to helm/lifecycle_contants file.

This commit updates all references that pointed to the lifecycles
constants at sysinv/common/constants.py file, changing them to point to
the new variables in sysinv/helm/lifecycle_contants.py

Test plan:
PASS: build-pkgs && build-image
PASS: AIO-SX fresh install
PASS: Upload, apply, remove, delete, update and upgrade vault app.

Story: 2011242
Task: 51572
Depends-on: https://review.opendev.org/c/starlingx/config/+/936252

Change-Id: I144d5050d996a433e3c1268155f35599489c9589
Signed-off-by: Edson Dias <edson.dias@windriver.com>
This commit is contained in:
Edson Dias 2025-01-02 11:11:46 -03:00
parent fd6f4311e2
commit 0b4159ede2

@ -16,6 +16,7 @@ from sysinv.common import constants
from sysinv.common import kubernetes
from sysinv.common import utils as cutils
from sysinv.helm import lifecycle_base as base
from sysinv.helm.lifecycle_constants import LifecycleConstants
import time
LOG = logging.getLogger(__name__)
@ -41,9 +42,9 @@ class VaultAppLifecycleOperator(base.AppLifecycleOperator):
:param hook_info: LifecycleHookInfo object
"""
if (hook_info.lifecycle_type == constants.APP_LIFECYCLE_TYPE_RESOURCE
if (hook_info.lifecycle_type == LifecycleConstants.APP_LIFECYCLE_TYPE_RESOURCE
and hook_info.operation == constants.APP_APPLY_OP
and hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_PRE):
and hook_info.relative_timing == LifecycleConstants.APP_LIFECYCLE_TIMING_PRE):
try:
self.read_pvc_secret(app_op._kube._get_kubernetesclient_core())
except Exception: # nosec # pylint: disable=broad-exception-caught