From fb7d081bc89d9d2a80f0d49a32413c81f2d04289 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 20 Aug 2021 18:52:03 +0300 Subject: [PATCH] Fix horizon compilemessages with murano ui enabled Currently if you enable murano UI and try to compile messages you will be thrown `NameError: name 'HORIZON_CONFIG' is not defined So we explicitly import HORIZON_CONFIG along with POLICY_FILES to make horizon successfully compile when murano-ui was enabled. Change-Id: Id5ab97349f702be1afc536c154cf0e35197150b8 --- .../local/local_settings.d/_50_murano.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/muranodashboard/local/local_settings.d/_50_murano.py b/muranodashboard/local/local_settings.d/_50_murano.py index bb6df84ec..9189fc7e2 100644 --- a/muranodashboard/local/local_settings.d/_50_murano.py +++ b/muranodashboard/local/local_settings.d/_50_murano.py @@ -47,10 +47,18 @@ try: except ImportError: LEGACY_STATIC_SETTINGS = False -HORIZON_CONFIG['legacy_static_settings'] = LEGACY_STATIC_SETTINGS +try: + from openstack_dashboard.settings import HORIZON_CONFIG + HORIZON_CONFIG['legacy_static_settings'] = LEGACY_STATIC_SETTINGS +except ImportError: + HORIZON_CONFIG = {} + HORIZON_CONFIG['legacy_static_settings'] = LEGACY_STATIC_SETTINGS -# from openstack_dashboard.settings import POLICY_FILES -POLICY_FILES.update({'murano': 'murano_policy.json',}) +try: + from openstack_dashboard.settings import POLICY_FILES + POLICY_FILES.update({'murano': 'murano_policy.json',}) +except ImportError: + POLICY_FILES = {'murano': 'murano_policy.json',} # Applications using the encryptData/decryptData yaql functions will require # the below to be configured