--- 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)