Skip to content

Commit

Permalink
Add response callback to _invoke_one_plugin().
Browse files Browse the repository at this point in the history
Change the response list argument to _invoke_one_plugin()
to a callback that accepts the response value.

Signed-off-by: Doug Hellmann <doug.hellmann@dreamhost.com>
  • Loading branch information
Doug Hellmann committed Aug 21, 2012
1 parent 79bd21f commit a9de3ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions stevedore/extension.py
Expand Up @@ -100,12 +100,12 @@ def func(ext, *args, **kwds):
raise RuntimeError('No %s extensions found' % self.namespace)
response = []
for e in self.extensions:
self._invoke_one_plugin(response, func, e, args, kwds)
self._invoke_one_plugin(response.append, func, e, args, kwds)
return response

def _invoke_one_plugin(self, response, func, e, args, kwds):
def _invoke_one_plugin(self, response_callback, func, e, args, kwds):
try:
response.append(func(e, *args, **kwds))
response_callback(func(e, *args, **kwds))
except Exception as err:
# FIXME: Provide an argument to control
# whether to ignore exceptions in each
Expand Down

0 comments on commit a9de3ec

Please sign in to comment.