diff options
| author | Daniel Reis <dgreis@sapo.pt> | 2015-04-16 09:45:39 +0100 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2015-07-12 16:40:55 +0200 |
| commit | e20cf77ce0546ac37dbfabd8c71a0ab33cedc3d7 (patch) | |
| tree | 214429a2fbc9f37ecf835f353805df4a35380606 | |
| parent | 99a7d530e05653448d21214b427bcbbebd348da9 (diff) | |
[FIX] cli: Backport client command discovery optimization
Lazy load modules to avoid import of unmet dependencies such as ldap.
| -rw-r--r-- | openerp/cli/__init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/openerp/cli/__init__.py b/openerp/cli/__init__.py index 31582d95292..c061175ac3e 100644 --- a/openerp/cli/__init__.py +++ b/openerp/cli/__init__.py @@ -56,12 +56,9 @@ def main(): if len(args) and not args[0].startswith("-"): logging.disable(logging.CRITICAL) for m in module.get_modules(): - m = 'openerp.addons.' + m - __import__(m) - #try: - #except Exception, e: - # raise - # print e + m_path = module.get_module_path(m) + if os.path.isdir(os.path.join(m_path, 'cli')): + __import__('openerp.addons.' + m) logging.disable(logging.NOTSET) command = args[0] args = args[1:] |
