Merge "Adding semantic check on platform-integ-apps reapply operation"

This commit is contained in:
Zuul 2024-02-05 17:45:04 +00:00 committed by Gerrit Code Review
commit 585fee6033

View File

@ -40,7 +40,8 @@ class PlatformAppLifecycleOperator(base.AppLifecycleOperator):
# Semantic checks # Semantic checks
if hook_info.lifecycle_type == constants.APP_LIFECYCLE_TYPE_SEMANTIC_CHECK: if hook_info.lifecycle_type == constants.APP_LIFECYCLE_TYPE_SEMANTIC_CHECK:
if hook_info.mode == constants.APP_LIFECYCLE_MODE_AUTO and \ if hook_info.mode == constants.APP_LIFECYCLE_MODE_AUTO and \
hook_info.operation == constants.APP_APPLY_OP and \ hook_info.operation in [constants.APP_APPLY_OP,
constants.APP_EVALUATE_REAPPLY_OP] and \
hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_PRE: hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_PRE:
return self.pre_auto_apply_check(conductor_obj) return self.pre_auto_apply_check(conductor_obj)
@ -85,6 +86,12 @@ class PlatformAppLifecycleOperator(base.AppLifecycleOperator):
if not os.path.isfile(crushmap_flag_file): if not os.path.isfile(crushmap_flag_file):
raise exception.LifecycleSemanticCheckException( raise exception.LifecycleSemanticCheckException(
"Crush map not applied") "Crush map not applied")
# conductor_obj._ceph (CephOperator) may not be initialized
# at this point, as it depends on ceph and system conditions
# to start the thread that initializes it
if conductor_obj._ceph is None:
raise exception.LifecycleSemanticCheckException(
"CephOperator is not initialized yet")
if not conductor_obj._ceph.have_ceph_monitor_access(): if not conductor_obj._ceph.have_ceph_monitor_access():
raise exception.LifecycleSemanticCheckException( raise exception.LifecycleSemanticCheckException(
"Monitor access error") "Monitor access error")