From 4bb0586db2a375f42ee4b36ccb80dc2cdc3a083e Mon Sep 17 00:00:00 2001 From: Bart Wensley Date: Tue, 5 Feb 2019 14:12:12 -0600 Subject: [PATCH] Update criteria to determine if stx-openstack is installed The current check to determine if the stx-openstack application is installed just checks for the APP_APPLY_SUCCESS status. However, the application can be re-applied (either manually or automatically when a host is unlocked) and can then transition to the APP_APPLY_IN_PROGRESS or APP_APPLY_FAILURE status. Updating the check to account for these two additional status, which also indicate that the stx-openstack application is installed. Change-Id: I02e92eb5bcbc70c7802e4e46dc608fc08c86b1c6 story: 2002843 task: 29361 Signed-off-by: Bart Wensley --- sysinv/sysinv/sysinv/sysinv/common/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sysinv/sysinv/sysinv/sysinv/common/utils.py b/sysinv/sysinv/sysinv/sysinv/common/utils.py index 8f829eb233..c167a7b77b 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/utils.py +++ b/sysinv/sysinv/sysinv/sysinv/common/utils.py @@ -1785,7 +1785,13 @@ def is_openstack_installed(dbapi): """ Checks whether the OpenStack application is installed. """ try: openstack_app = dbapi.kube_app_get(constants.HELM_APP_OPENSTACK) - if openstack_app.status == constants.APP_APPLY_SUCCESS: + # The application can be re-applied (either manually or as a result of + # a host unlock, so it will cycle through the APP_APPLY_IN_PROGRESS + # status and possibly the APP_APPLY_FAILURE status, but still be + # installed. + if openstack_app.status in [constants.APP_APPLY_SUCCESS, + constants.APP_APPLY_IN_PROGRESS, + constants.APP_APPLY_FAILURE]: return True else: return False