beacon bliss plugin: legit `ImportError` is silenced
The find_class
function of bliss plugin in bliss/config/plugins/bliss.py
silences exceptions
if something wrong happens in first import
:
# discover module and class name
module_name = 'bliss.controllers.%s' % klass_name
try:
module = __import__(module_name, fromlist=[None])
except ImportError: # try in file in lower case
#
# problem here:
# if module exists but cannot be imported because it fails
# for some good reason (like, it tries in turn to import
# a missing module), code goes here and
# the lower case name is tried to be imported. Which will
# probably fail, and the exception message we get does
# not correspond to the real error since it will report
# it cannot find the lowercase version of the module
# instead of complaining with the original traceback.
#
module_name = 'bliss.controllers.%s' % klass_name.lower()
module = __import__(module_name, fromlist=[None])
How to fix that ?
I tend to think we should have a strict module name === class name correspondence, or to always try in lower case since it ensures more beautiful module file names.
What can be the more complicated fix ?
Any help would be appreciated.