diff options
author | Kevin Benton <kevin@benton.pub> | 2017-01-09 10:22:42 -0800 |
---|---|---|
committer | Kevin Benton <kevin@benton.pub> | 2017-01-09 10:25:47 -0800 |
commit | 04f5e154e521d593cee1f6a78d5beee8a5db0b13 (patch) | |
tree | 8a927028e207f6d133c276a7d478c3333cb1e608 | |
parent | 57e4c9cde4022cc0f50fe636e5f319abd658f4dd (diff) | |
download | stevedore-04f5e154e521d593cee1f6a78d5beee8a5db0b13.tar.gz |
Allow suppression of warnings from DriverManager
Some projects (e.g. Neutron) using the DriverManager with
another fallback mechanism when the alias doesn't exist don't
want the "Could not load warning" messages in the logs.
This patch allows the warn_on_missing_entrypoint kwarg to be
passed to DriverManager which passes it up to its parent
NamedExtensionManager.
Change-Id: Ia6f5f749fc2f73ca6091fa6d58506fddb058902a
-rw-r--r-- | stevedore/driver.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/stevedore/driver.py b/stevedore/driver.py index a4b33b2..167dc67 100644 --- a/stevedore/driver.py +++ b/stevedore/driver.py @@ -40,12 +40,14 @@ class DriverManager(NamedExtensionManager): :param verify_requirements: Use setuptools to enforce the dependencies of the plugin(s) being loaded. Defaults to False. :type verify_requirements: bool + :type warn_on_missing_entrypoint: bool """ def __init__(self, namespace, name, invoke_on_load=False, invoke_args=(), invoke_kwds={}, on_load_failure_callback=None, - verify_requirements=False): + verify_requirements=False, + warn_on_missing_entrypoint=True): on_load_failure_callback = on_load_failure_callback \ or self._default_on_load_failure super(DriverManager, self).__init__( @@ -56,6 +58,7 @@ class DriverManager(NamedExtensionManager): invoke_kwds=invoke_kwds, on_load_failure_callback=on_load_failure_callback, verify_requirements=verify_requirements, + warn_on_missing_entrypoint=warn_on_missing_entrypoint ) @staticmethod |