From 62743fec6a0e0498bdcfc9973d4ad8225f48c101 Mon Sep 17 00:00:00 2001 From: Jim Rollenhagen Date: Fri, 15 Jul 2016 18:52:22 +0000 Subject: [PATCH] Update to work with latest stevedore stevedore no longer raises a KeyError when there's an entrypoint missing. Instead we must supply a callback that handles that error. Update inspection code to work with this. Also bumps stevedore minimum to 1.16 ahead of the global-requirements bot. Closes-Bug: #1603542 Change-Id: I12af23f2525ac90e577bdd10bbfbbd9788e9551c Depends-On: I8aa1ee52ff7de50488acb86e8920da89ddb05771 --- ironic_python_agent/inspector.py | 13 +++++++------ requirements.txt | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ironic_python_agent/inspector.py b/ironic_python_agent/inspector.py index 766ce2baa..bcd544892 100644 --- a/ironic_python_agent/inspector.py +++ b/ironic_python_agent/inspector.py @@ -42,13 +42,14 @@ _COLLECTOR_NS = 'ironic_python_agent.inspector.collectors' _NO_LOGGING_FIELDS = ('logs',) +def _extension_manager_err_callback(names): + raise errors.InspectionError('Failed to load collector %s' % names) + + def extension_manager(names): - try: - return stevedore.NamedExtensionManager(_COLLECTOR_NS, - names=names, - name_order=True) - except KeyError as exc: - raise errors.InspectionError('Failed to load collector %s' % exc) + return stevedore.NamedExtensionManager( + _COLLECTOR_NS, names=names, name_order=True, + on_missing_entrypoints_callback=_extension_manager_err_callback) def inspect(): diff --git a/requirements.txt b/requirements.txt index c4190975d..182c73bfe 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,6 +19,6 @@ pyudev # LGPLv2.1+ requests>=2.10.0 # Apache-2.0 rtslib-fb>=2.1.41 # Apache-2.0 six>=1.9.0 # MIT -stevedore>=1.10.0 # Apache-2.0 +stevedore>=1.16.0 # Apache-2.0 WSME>=0.8 # MIT ironic-lib>=2.0.0 # Apache-2.0