summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-30 14:41:38 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-30 14:41:38 +0200
commit6773c015c5422f4b265ba59fb190fc22156d0469 (patch)
tree1bec386ac9ff59990454a5539aed423f2ac9a340
parentbb2020d418255e0a3767878c48474896ed57c55a (diff)
downloadpykolab-6773c015c5422f4b265ba59fb190fc22156d0469.tar.gz
Do not load commands that fail loading (#811)
-rw-r--r--pykolab/cli/commands.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pykolab/cli/commands.py b/pykolab/cli/commands.py
index f1b9ac8..6dedc6c 100644
--- a/pykolab/cli/commands.py
+++ b/pykolab/cli/commands.py
@@ -43,7 +43,11 @@ def __init__():
module_name = filename.replace('.py','')
cmd_name = module_name.replace('cmd_', '')
#print "exec(\"from %s import __init__ as %s_register\"" % (module_name,cmd_name)
- exec("from %s import __init__ as %s_register" % (module_name,cmd_name))
+ try:
+ exec("from %s import __init__ as %s_register" % (module_name,cmd_name))
+ except ImportError, errmsg:
+ pass
+
exec("%s_register()" % (cmd_name))
for dirname in dirnames: