Add missing parameter in call to _load_one_plugin
Stevedore 0.14 introduced a new paramter to the private method ExtensionManager._load_one_plugin(). This broke our unit test suite, and this patch adds that parameter to the call. This patch supports both Stevedore < 0.14 and >= 0.14. Once we can pin the version to >= 0.14, we should remove support for the old-style call to _load_one_plugin. For reference, we are directly calling this private method to provide a mock-able extension manager and a corresponding fake extension for testing the Conductor and the various extensions it loads. Change-Id: Ib51f841af00548c3e20128f44a4b7a48422c1aa9 Closes-bug: #1273472
This commit is contained in:
parent
5983ad8523
commit
087a8ea666
@ -50,6 +50,13 @@ def get_mockable_extension_manager(driver, namespace):
|
|||||||
dispatch.NameDispatchExtensionManager('ironic.no-such-namespace',
|
dispatch.NameDispatchExtensionManager('ironic.no-such-namespace',
|
||||||
lambda x: True)
|
lambda x: True)
|
||||||
mock_ext_mgr = driver_factory.DriverFactory()
|
mock_ext_mgr = driver_factory.DriverFactory()
|
||||||
|
try:
|
||||||
|
mock_ext = mock_ext_mgr._extension_manager._load_one_plugin(
|
||||||
|
entry_point, True, [], {},
|
||||||
|
False)
|
||||||
|
except TypeError:
|
||||||
|
# TODO(deva): remove this after I7f4cec7071 lands and stevedore is
|
||||||
|
# pinned >= 0.14 in requirements.txt
|
||||||
mock_ext = mock_ext_mgr._extension_manager._load_one_plugin(
|
mock_ext = mock_ext_mgr._extension_manager._load_one_plugin(
|
||||||
entry_point, True, [], {})
|
entry_point, True, [], {})
|
||||||
mock_ext_mgr._extension_manager.extensions = [mock_ext]
|
mock_ext_mgr._extension_manager.extensions = [mock_ext]
|
||||||
|
Loading…
Reference in New Issue
Block a user