Raise detailed exception
This change allows to throw a detailed exception
in case if 'files' list has 'None' value:
"""
Exception occurred:
File "/<<PKGBUILDDIR>>/openstack_dashboard/utils/\
settings.py", line 263, in get_xstatic_dirs
for file in files:
TypeError: 'NoneType' object is not iterable
"""
Closes-Bug:
@@ -265,9 +265,16 @@ def get_xstatic_dirs(XSTATIC_MODULES, HORIZON_CONFIG):
files = [file for file in files if file.endswith('.js')]
# add to the list of files to link in the HTML
+ try:
for file in files:
file = 'horizon/lib/' + module.NAME + '/' + file
HORIZON_CONFIG['xstatic_lib_files'].append(file)
+ except TypeError:
+ raise Exception(
+ '%s: Nothing to include because files to include are not '
+ 'defined (i.e., None) in BASE_XSTATIC_MODULES list and '
+ 'a corresponding XStatic module does not define MAIN list.'
+ % module_name)
return STATICFILES_DIRS
