Change in vdsm[master]: tool: autoload modules.
danken at redhat.com
danken at redhat.com
Tue Jan 6 16:47:21 UTC 2015
Dan Kenigsberg has posted comments on this change.
Change subject: tool: autoload modules.
......................................................................
Patch Set 12: Code-Review-1
(3 comments)
http://gerrit.ovirt.org/#/c/34049/12//COMMIT_MSG
Commit Message:
Line 3: AuthorDate: 2014-10-12 01:04:03 +0300
Line 4: Commit: Mooli Tayer <mtayer at redhat.com>
Line 5: CommitDate: 2015-01-06 17:05:32 +0200
Line 6:
Line 7: tool: autoload modules.
Please add a word on why autoload is a smart idea.
(I believe it simplifies adding new configurators, but maybe there more to it?)
Line 8:
Line 9: The import of validate_ovirt_certs needed a change due to autoload.
Line 10:
Line 11: Change-Id: I6cc14a1c409ee607e18d42adcd8a54759d8dbf6d
http://gerrit.ovirt.org/#/c/34049/12/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:
Line 38: service, \
Line 39: expose, \
Line 40: UsageError, \
Line 41: requiresRoot
Line 42: from . import configurators
I'd love if you can split this change: importing the module (instead of its elements) has nothing to do with autoloading.
Line 43:
Line 44:
Line 45: def _import_module(abspkg, mname):
Line 46: """return imported module mname from abspkg."""
Line 56: filter_ = lambda x: not x.startswith('_')
Line 57:
Line 58: return [
Line 59: getmname(module)
Line 60: for module in glob("%s*.py" % path)
glob -> iglob
to avoid unnecessary temporary list
Line 61: if filter_(getmname(module))
Line 62: ]
Line 63:
Line 64:
--
To view, visit http://gerrit.ovirt.org/34049
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I6cc14a1c409ee607e18d42adcd8a54759d8dbf6d
Gerrit-PatchSet: 12
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Dima Kuznetsov <dkuznets at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybronhei at redhat.com>
Gerrit-Reviewer: Yeela Kaplan <ykaplan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: mooli tayer <mtayer at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list