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
This commit is contained in:
Dmitriy Rabotyagov 2021-08-20 18:52:03 +03:00
parent 6211c873cb
commit fb7d081bc8
1 changed files with 11 additions and 3 deletions

View File

@ -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