Add lifecycle semantic check for auto update

Stx-openstack app is not a RPM installed app which
doesn't support auto-update.

Change-Id: Iec0233910c9e7725c12767138e25b3bd314f82b0
Story: 2007960
Task: 42833
Depends-On: https://review.opendev.org/c/starlingx/config/+/800821/
Signed-off-by: Angie Wang <angie.wang@windriver.com>
This commit is contained in:
Angie Wang 2021-07-14 15:00:18 -04:00
parent 1e4fb63116
commit eec60f8b48
1 changed files with 6 additions and 3 deletions

View File

@ -76,9 +76,12 @@ class OpenstackAppLifecycleOperator(base.AppLifecycleOperator):
# Semantic checks
elif hook_info.lifecycle_type == constants.APP_LIFECYCLE_TYPE_SEMANTIC_CHECK:
if hook_info.mode == constants.APP_LIFECYCLE_MODE_AUTO and \
hook_info.operation == constants.APP_EVALUATE_REAPPLY_OP:
return self._semantic_check_evaluate_app_reapply(app_op, app, hook_info)
if hook_info.mode == constants.APP_LIFECYCLE_MODE_AUTO:
if hook_info.operation == constants.APP_EVALUATE_REAPPLY_OP:
return self._semantic_check_evaluate_app_reapply(app_op, app, hook_info)
elif hook_info.operation == constants.APP_UPDATE_OP:
raise exception.LifecycleSemanticCheckOperationNotSupported(
mode=constants.APP_LIFECYCLE_MODE_AUTO, op=constants.APP_UPDATE_OP, name=app.name)
elif hook_info.mode == constants.APP_LIFECYCLE_MODE_MANUAL and \
hook_info.operation == constants.APP_APPLY_OP and \
hook_info.relative_timing == constants.APP_LIFECYCLE_TIMING_PRE: