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):
16 self.mgr = stevedore.extension.ExtensionManager(namespace="vswitch.plugins", invoke_on_load=True)
22 for plugin in self.mgr.names():
23 self.mgr[plugin].obj.clean()
26 def get_vs_plugin(self, plugin):
27 if plugin in self.mgr.names():
28 ext = self.mgr[plugin]
32 raise Exception("unsupported vswitch plugin: %s" % plugin)
34 def get_supported_plugins(self):
35 return self.mgr.names()