mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-25 17:27:01 +00:00
The imported module name must be unique. Otherwise the existing import will just be reused.
This commit is contained in:
@@ -428,7 +428,8 @@ class Base:
|
||||
self.log.info("loading plugins from %s", pyPath)
|
||||
with open(pyPath) as fd:
|
||||
sfx = ('.py', 'U', imp.PY_SOURCE,)
|
||||
mod = imp.load_module("plugin", fd, pyPath, sfx)
|
||||
moduleName = os.path.splitext(os.path.basename(pyPath))[0]
|
||||
mod = imp.load_module("onl_install_plugin_%s" % moduleName, fd, pyPath, sfx)
|
||||
for attr in dir(mod):
|
||||
klass = getattr(mod, attr)
|
||||
if isinstance(klass, type) and issubclass(klass, Plugin):
|
||||
|
||||
Reference in New Issue
Block a user