mirror of
https://github.com/Telecominfraproject/OpenNetworkLinux.git
synced 2025-12-26 17:57:01 +00:00
Merge branch 'master' of github.com:carlroth/OpenNetworkLinux
This commit is contained in:
@@ -438,10 +438,12 @@ class Base:
|
||||
|
||||
def loadPlugins(self):
|
||||
|
||||
# scrape any plugins from the installer working directory
|
||||
pat = os.path.join(self.im.installerConf.installer_dir, "plugins", "*.py")
|
||||
for src in glob.glob(pat):
|
||||
self.loadPluginsFromFile(src)
|
||||
|
||||
# scrape any plugins from the installer archive
|
||||
pat = "plugins/*.py"
|
||||
for basename in self.zf.namelist():
|
||||
if not fnmatch.fnmatch(basename, pat): continue
|
||||
@@ -457,6 +459,18 @@ class Base:
|
||||
if src and os.path.exists(src):
|
||||
os.unlink(src)
|
||||
|
||||
# scrape plugins from the loader runtime
|
||||
# (any plugins dropped into $pydir/onl/install/plugins/*.py)
|
||||
try:
|
||||
import onl.install.plugins
|
||||
plugindir = os.path.dirname(onl.install.plugins.__file__)
|
||||
except ImportError:
|
||||
plugindir = None
|
||||
if plugindir:
|
||||
pat = os.path.join(plugindir, "*.py")
|
||||
for src in glob.glob(pat):
|
||||
self.loadPluginsFromFile(src)
|
||||
|
||||
return 0
|
||||
|
||||
def runPlugins(self, mode):
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
"""__init__.py
|
||||
|
||||
Module init for installer plugins.
|
||||
|
||||
DO NOT auto-load modules from here.
|
||||
Rather, drop files here so they will be processed by the installer.
|
||||
"""
|
||||
Reference in New Issue
Block a user