summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-10-22 20:30:40 -0600
committerJason Gerard DeRose <jderose@redhat.com>2008-10-22 20:30:40 -0600
commit98da855176cdd32021a850bb55d91cd53d77e1f5 (patch)
treeb339cef67bb1dbbc7df5d453d73e3b537753981f /ipalib/cli.py
parent4da1f096751f000efcd7eb5ca3b7d719f3ce5581 (diff)
parent1daf319a19f902d7c7bef37af065cac81be9189e (diff)
downloadfreeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.tar.gz
freeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.tar.xz
freeipa.git-98da855176cdd32021a850bb55d91cd53d77e1f5.zip
Merge branch 'master' of git://git.engineering.redhat.com/users/rcritten/freeipa2
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index ab7e3620..4e5e433e 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -270,7 +270,7 @@ class CLI(object):
self.print_commands()
print 'ipa: ERROR: unknown command %r' % key
sys.exit(2)
- self.run_cmd(
+ return self.run_cmd(
self[key],
list(s.decode('utf-8') for s in args[1:])
)
@@ -280,7 +280,11 @@ class CLI(object):
try:
self.run_interactive(cmd, kw)
except KeyboardInterrupt:
- return
+ return 0
+ except errors.RuleError, e:
+ print e
+ return 2
+ return 0
def run_interactive(self, cmd, kw):
for param in cmd.params():