1 ##############################################################################
2 # Copyright (c) 2015 Huawei Technologies Co.,Ltd and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
13 class VswitchPluginManager(object):
17 self.mgr = stevedore.extension.ExtensionManager(
18 namespace="vswitch.plugins", invoke_on_load=True)
24 for plugin in self.mgr.names():
25 self.mgr[plugin].obj.clean()
28 def get_vs_plugin(self, plugin):
29 if plugin in self.mgr.names():
30 ext = self.mgr[plugin]
34 raise Exception("unsupported vswitch plugin: %s" % plugin)
36 def get_supported_plugins(self):
37 return self.mgr.names()