cwctl.py
changeset 7595 83872394b5d9
parent 7591 cb6ece9cdb78
parent 7593 0c1024b3e7fc
child 7815 2a164a9cf81c
--- a/cwctl.py	Wed Jun 29 16:29:15 2011 +0200
+++ b/cwctl.py	Fri Jul 01 11:51:04 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)