# HG changeset patch # User Sylvain Thénault # Date 1309511952 -7200 # Node ID 0c1024b3e7fc22f7f024d7d0b3395cd7d40707df # Parent c84436b797937af071dbf7e38a16aed118792e9e [c-c instance commands] keyboard interrupt should stop the command, not jump to the next instance. Closes #1794850 diff -r c84436b79793 -r 0c1024b3e7fc cwctl.py --- a/cwctl.py Fri Jul 01 11:18:16 2011 +0200 +++ b/cwctl.py Fri Jul 01 11:19:12 2011 +0200 @@ -152,16 +152,17 @@ print '*'*72 if not ASK.confirm('%s instance %r ?' % (self.name, appid)): continue - status = max(status, self.run_arg(appid)) + try: + status = max(status, self.run_arg(appid)) + except (KeyboardInterrupt, SystemExit): + print >> sys.stderr, '%s aborted' % self.name + return 2 # specific error code sys.exit(status) def run_arg(self, appid): cmdmeth = getattr(self, '%s_instance' % self.name) try: status = cmdmeth(appid) - except (KeyboardInterrupt, SystemExit): - print >> sys.stderr, '%s aborted' % self.name - return 2 # specific error code except (ExecutionError, ConfigurationError), ex: print >> sys.stderr, 'instance %s not %s: %s' % ( appid, self.actionverb, ex)