Fix flake8 failures from pull/27
Fix a few formatting issues from within the previous pull request. Change-Id: Iadb0d5d4bfa1ac460c730e8af0cfec9386a4c066
This commit is contained in:
parent
974f4fbc5a
commit
4b3f616eb4
@ -88,7 +88,8 @@ class DispatchExtensionManager(EnabledExtensionManager):
|
||||
.. versionadded:: 0.12
|
||||
|
||||
:param filter_func: Callable to test each extension.
|
||||
:param method_name: The extension method name to call for each extension.
|
||||
:param method_name: The extension method name to call
|
||||
for each extension.
|
||||
:param args: Variable arguments to pass to method
|
||||
:param kwds: Keyword arguments to pass to method
|
||||
:returns: List of values returned from methods
|
||||
@ -190,7 +191,8 @@ class NameDispatchExtensionManager(DispatchExtensionManager):
|
||||
.. versionadded:: 0.12
|
||||
|
||||
:param names: List or set of name(s) of extension(s) to invoke.
|
||||
:param method_name: The extension method name to call for each extension.
|
||||
:param method_name: The extension method name
|
||||
to call for each extension.
|
||||
:param args: Variable arguments to pass to method
|
||||
:param kwds: Keyword arguments to pass to method
|
||||
:returns: List of values returned from methods
|
||||
|
@ -145,7 +145,7 @@ class ExtensionManager(object):
|
||||
return getattr(extension.obj, method_name)(*args, **kwds)
|
||||
|
||||
def map_method(self, method_name, *args, **kwds):
|
||||
"""Iterate over the extensions invoking each one's object method called `method_name`.
|
||||
"""Iterate over the extensions invoking a method by name.
|
||||
|
||||
This is equivalent of using :meth:`map` with func set to
|
||||
`lambda x: x.obj.method_name()`
|
||||
@ -157,12 +157,14 @@ class ExtensionManager(object):
|
||||
|
||||
.. versionadded:: 0.12
|
||||
|
||||
:param method_name: The extension method name to call for each extension.
|
||||
:param method_name: The extension method name
|
||||
to call for each extension.
|
||||
:param args: Variable arguments to pass to method
|
||||
:param kwds: Keyword arguments to pass to method
|
||||
:returns: List of values returned from methods
|
||||
"""
|
||||
return self.map(self._call_extension_method, method_name, *args, **kwds)
|
||||
return self.map(self._call_extension_method,
|
||||
method_name, *args, **kwds)
|
||||
|
||||
def _invoke_one_plugin(self, response_callback, func, e, args, kwds):
|
||||
try:
|
||||
|
@ -88,6 +88,7 @@ def test_name_dispatch_ignore_missing():
|
||||
expected = [('t1', ('first',), {'named': 'named value'})]
|
||||
assert results == expected
|
||||
|
||||
|
||||
def test_name_dispatch_map_method():
|
||||
em = dispatch.NameDispatchExtensionManager(
|
||||
'stevedore.test.extension',
|
||||
|
Loading…
Reference in New Issue
Block a user