Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Python module stevedore can not raise any exception?

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:
       LOG.info("here is here")
       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

Python module stevedore can not raise any exception?

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:
       LOG.info("here is here")
       self.manager.map(_filter_func,
                            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

Python module stevedore can not raise any exception?

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