Only log error when no load handler is set

Only log an error from loading a plugin if no load
failure handler callback is provided. Otherwise,
assume the handler will do any logging it wants.

Change-Id: Iac83f3c140067bc3d1996c40c0184e4a0d0b564a
This commit is contained in:
Doug Hellmann 2014-03-27 10:22:33 -07:00
parent 180b1789e3
commit 2bbf3eb569
1 changed files with 3 additions and 2 deletions

View File

@ -166,10 +166,11 @@ class ExtensionManager(object):
except (KeyboardInterrupt, AssertionError):
raise
except Exception as err:
LOG.error('Could not load %r: %s', ep.name, err)
LOG.exception(err)
if self._on_load_failure_callback is not None:
self._on_load_failure_callback(self, ep, err)
else:
LOG.error('Could not load %r: %s', ep.name, err)
LOG.exception(err)
return extensions
def _load_one_plugin(self, ep, invoke_on_load, invoke_args, invoke_kwds,