cwctl.py
branchstable
changeset 7593 0c1024b3e7fc
parent 7538 849c04098f3f
child 7595 83872394b5d9
--- 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)