diff --git a/openmtc-gevent/src/openmtc_gevent/main.py b/openmtc-gevent/src/openmtc_gevent/main.py index c5cce00..619323d 100644 --- a/openmtc-gevent/src/openmtc_gevent/main.py +++ b/openmtc-gevent/src/openmtc_gevent/main.py @@ -178,7 +178,9 @@ def stop_plugin(plugin): def stop_plugins(): - map(stop_plugin, _plugins) + # stop transport plugins after the others + map(stop_plugin, filter(lambda p: not p.name.endswith('TransportPlugin'), _plugins)) + map(stop_plugin, filter(lambda p: p.name.endswith('TransportPlugin'), _plugins)) def init_component(component, api): diff --git a/server/openmtc-server/src/openmtc_server/Plugin.py b/server/openmtc-server/src/openmtc_server/Plugin.py index 0573ac8..f6d6dac 100644 --- a/server/openmtc-server/src/openmtc_server/Plugin.py +++ b/server/openmtc-server/src/openmtc_server/Plugin.py @@ -97,6 +97,7 @@ class Plugin(BasicPlugin): self.api = api self.events = api.events + self.name = self.__class__.__name__ def get_shelve(self, name): return self.api.db.get_shelve("%s_%s" % (type(self).__name__, name))