Alon Bar-Lev has uploaded a new change for review. Change subject: core: support nested plugins ......................................................................
core: support nested plugins Change-Id: I99c7eb33a258372e8fb8068a5d8271a999138c1d Signed-off-by: Alon Bar-Lev <[email protected]> --- M ChangeLog M src/otopi/context.py 2 files changed, 14 insertions(+), 10 deletions(-) git pull ssh://gerrit.ovirt.org:29418/otopi refs/changes/63/20563/1 diff --git a/ChangeLog b/ChangeLog index eb40350..8c0e1f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ * core: support binary file transaction. * core: fix suppress environment variable logic. * core: log: add indirect filtering. + * core: support nested plugins. * dialog: cli: fix exception show. * packagers: yum: support disable transaction rollback. * network: firewalld: fix service deletion. diff --git a/src/otopi/context.py b/src/otopi/context.py index 4962359..f1814c3 100644 --- a/src/otopi/context.py +++ b/src/otopi/context.py @@ -71,23 +71,26 @@ print(msg) def _loadPlugins(self, base, groupname): - for p in glob.glob(os.path.join(base, '*')): - if ( - os.path.isdir(p) and - os.path.basename(p)[0] not in ('_', '.') and - glob.glob(os.path.join(p, '__init__.py*')) - ): + if ( + os.path.isdir(base) and + os.path.basename(base)[0] not in ('_', '.') + ): + if not glob.glob(os.path.join(base, '__init__.py*')): + for d in glob.glob(os.path.join(base, '*')): + self._loadPlugins(d, groupname) + else: self._earlyDebug( - 'Loading plugin %s:%s' % ( + 'Loading plugin %s:%s (%s)' % ( groupname, - os.path.basename(p), + os.path.basename(base), + base, ) ) util.loadModule( - base, + os.path.dirname(base), 'otopi.plugins.%s.%s' % ( groupname.replace('-', '_'), - os.path.basename(p), + os.path.basename(base), ), ).createPlugins(self) -- To view, visit http://gerrit.ovirt.org/20563 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99c7eb33a258372e8fb8068a5d8271a999138c1d Gerrit-PatchSet: 1 Gerrit-Project: otopi Gerrit-Branch: master Gerrit-Owner: Alon Bar-Lev <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
