summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-21 14:42:13 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-21 14:42:13 -0400
commitbc5edcf8939d5ed2bcd3ee9dcc3bc80979bf563a (patch)
tree5889f3c9a8f500f833982b21b79a2fce95c6b78c
parent475265ed378cd0879d22e2b9bc59f7eab742fee9 (diff)
downloadfreeipa-bc5edcf8939d5ed2bcd3ee9dcc3bc80979bf563a.tar.gz
freeipa-bc5edcf8939d5ed2bcd3ee9dcc3bc80979bf563a.tar.xz
freeipa-bc5edcf8939d5ed2bcd3ee9dcc3bc80979bf563a.zip
Gracefully handle keyboard interrupts (^C)
-rw-r--r--ipalib/cli.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 625280344..ab7e36204 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -277,7 +277,10 @@ class CLI(object):
def run_cmd(self, cmd, argv):
kw = self.parse(cmd, argv)
- self.run_interactive(cmd, kw)
+ try:
+ self.run_interactive(cmd, kw)
+ except KeyboardInterrupt:
+ return
def run_interactive(self, cmd, kw):
for param in cmd.params():