Nir Soffer has posted comments on this change.

Change subject: configurator doesn't load pyc files under configurators folder
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/45846/2/lib/vdsm/tool/configurator.py
File lib/vdsm/tool/configurator.py:

Line 57:     filter_ = lambda x: not x.startswith('_')
Line 58: 
Line 59:     return set(
Line 60:         getmname(module)
Line 61:         for module in iglob("%s*.py*" % path)
This will match also foo.pybar :-)

We do not expect to have other files except *.py and *.pyc, but this code is 
wrong, and will fail in the future when used in other context.

This is simpler, more clear and correct:

    is_module = re.compile(r"^[^_].*\.pyc?$").search

    return set(os.path.splitext(name)[0] for name in os.listdir(path) if 
is_module(name))
Line 62:         if filter_(getmname(module))
Line 63:     )
Line 64: 
Line 65: 


-- 
To view, visit https://gerrit.ovirt.org/45846
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia529de0069e2f4ec168a4b9df82ba62c56d66730
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: Piotr Kliczewski <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to