Python module stevedore can not raise any exception?

asked 2017-06-28 04:03:09 -0500

zero gravatar image

updated 2017-06-28 04:06:09 -0500

I am using python Stevedore module to extend my some plugins of my application. I found a very serious problem, when I running some tests. Stevedore load these plugins, if there is something wrong in the code of plugins, and plugins raise error or exceptions, the Stevedore would automatically ignore (looks like nothing happened). It makes really hard to debug my plugins and my application. Am I use Stevedore module in wrong way, is there any way to raise the exception?

my code is something like this:

from stevedore.dispatch import DispatchExtensionManager
class DispatchManager(object):

    def __init__(self, services=[]):
        self.services = services
        self.manager = DispatchExtensionManager(
            namespace='racoon.dispatcher',
            check_func=lambda ext: ext.name in self.services,
            invoke_on_load=True,
            propagate_map_exceptions=True
        )
    def dispatch(self, messages):

       def _filter_func(ext, message):
           test = message.get('test')
           prefix = test.split('.')[0]
           return prefix == ext.name

       def process_func(ext, message):
           ext.obj.dispatch(message)

       for m in messages:
           self.manager.map(_filter_func, process_func, m)

if there some exceptions or error happens in the map method, nothing will raise.

anyone can help? thanks in advance

edit retag flag offensive close merge delete