summaryrefslogtreecommitdiffstats
path: root/pykolab/cli
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:43:12 +0200
commit588fd44c3aab2e8e22e801b4a0e763d3d7b5d00c (patch)
treee0ae0ab8e8d656060ff8289932da1265f0b3a6fd /pykolab/cli
parentdff3849c91d407b21ea65c873a9e34733bc48f9c (diff)
downloadpykolab-588fd44c3aab2e8e22e801b4a0e763d3d7b5d00c.tar.gz
Do not load commands that fail loading (#811)
Diffstat (limited to 'pykolab/cli')
-rw-r--r--pykolab/cli/commands.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pykolab/cli/commands.py b/pykolab/cli/commands.py
index 7236b0b..155a110 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:
@@ -189,4 +193,4 @@ def register(cmd_name, func, group=None, description=None, aliases=[]):
def not_yet_implemented(*args, **kw):
print _("Not yet implemented")
- sys.exit(1) \ No newline at end of file
+ sys.exit(1)