stevedore/stevedore/tests/extension_unimportable.py
Julien Danjou 3668de2513 driver: raise by default on import failure
When using the DriverManager class, if the driver fails to load, it's
actually better by default to re-raise the exception. It's not something
possible when loading multiple extension, but it's safe to do so with
drivers. This just changes the default behaviour, and it can still be
overridden.

The upside of that change is that when you try to load a driver that
cannot be loaded because of missing dependency, you actually get the
ImportError backtrace on your screen rather than the useless:
  RuntimeError: No 'foo' driver found, looking for 'bar'

which doesn't help at all. And the default mechanism that logs via
LOG.error() doesn't print anything at the screen if the application
didn't configure the logging subsystem.

Change-Id: I67d9e13a07c822c54dd16ac9ae7716747a24dd73
2014-04-25 14:51:45 +02:00

0 lines
Python