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
      node-interface-metrics-exporter.

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

Change-Id: I2e07de56316f561734a7e3a9f1e509dd5fdf3847
Signed-off-by: Edson Dias <edson.dias@windriver.com>
This commit is contained in:
Edson Dias 2025-01-02 15:58:34 -03:00
parent 9f4bbb93d4
commit 4af2df4f70

View File

@ -37,18 +37,18 @@ class NodeInterfaceMetricsExporterAppLifecycleOperator(base.AppLifecycleOperator
:param hook_info: LifecycleHookInfo object
"""
if hook_info.lifecycle_type == inv_constants.APP_LIFECYCLE_TYPE_FLUXCD_REQUEST:
if hook_info.lifecycle_type == LifecycleConstants.APP_LIFECYCLE_TYPE_FLUXCD_REQUEST:
if hook_info.operation == inv_constants.APP_APPLY_OP:
if hook_info.relative_timing == inv_constants.APP_LIFECYCLE_TIMING_POST:
if hook_info.relative_timing == LifecycleConstants.APP_LIFECYCLE_TIMING_POST:
return self.post_apply(app_op, app, hook_info)
if hook_info.relative_timing == inv_constants.APP_LIFECYCLE_TIMING_PRE:
if hook_info.relative_timing == LifecycleConstants.APP_LIFECYCLE_TIMING_PRE:
# on pre apply hook adding Label
self.assign_host_label(app_op)
if hook_info.lifecycle_type == inv_constants.APP_LIFECYCLE_TYPE_OPERATION:
if hook_info.lifecycle_type == LifecycleConstants.APP_LIFECYCLE_TYPE_OPERATION:
if hook_info.operation == inv_constants.APP_REMOVE_OP:
if hook_info.relative_timing == inv_constants.APP_LIFECYCLE_TIMING_POST:
if hook_info.relative_timing == LifecycleConstants.APP_LIFECYCLE_TIMING_POST:
# on post remove hook removing labels
self.remove_host_labels(app_op)
return self.post_remove(app)