[FIX] cli: Backport client command discovery optimization
Lazy load modules to avoid import of unmet dependencies such as ldap.
This commit is contained in:
parent
99a7d530e0
commit
e20cf77ce0
|
@ -56,12 +56,9 @@ def main():
|
||||||
if len(args) and not args[0].startswith("-"):
|
if len(args) and not args[0].startswith("-"):
|
||||||
logging.disable(logging.CRITICAL)
|
logging.disable(logging.CRITICAL)
|
||||||
for m in module.get_modules():
|
for m in module.get_modules():
|
||||||
m = 'openerp.addons.' + m
|
m_path = module.get_module_path(m)
|
||||||
__import__(m)
|
if os.path.isdir(os.path.join(m_path, 'cli')):
|
||||||
#try:
|
__import__('openerp.addons.' + m)
|
||||||
#except Exception, e:
|
|
||||||
# raise
|
|
||||||
# print e
|
|
||||||
logging.disable(logging.NOTSET)
|
logging.disable(logging.NOTSET)
|
||||||
command = args[0]
|
command = args[0]
|
||||||
args = args[1:]
|
args = args[1:]
|
||||||
|
|
Loading…
Reference in New Issue