Author: tmckay
Date: 2012-12-17 17:48:56 +0000 (Mon, 17 Dec 2012)
New Revision: 5609
Modified:
branches/elephant/cumin/python/cumin/task.py
Log:
Make task invocations follow Failed (exception) format in yellow
banners to be consistent with Aviary ops
Modified: branches/elephant/cumin/python/cumin/task.py
===================================================================
--- branches/elephant/cumin/python/cumin/task.py 2012-12-17 17:07:54 UTC (rev 5608)
+++ branches/elephant/cumin/python/cumin/task.py 2012-12-17 17:48:56 UTC (rev 5609)
@@ -172,7 +172,14 @@
if not description:
description = ""
status = xml_escape(str(self.get_status(session)))
- return "<span class='notification_time'>%s</span> %s:
%s" % ("%s-%02d-%02d %02d:%02d:%02d" % (timestamp.year, timestamp.month,
timestamp.day, timestamp.hour, timestamp.minute, timestamp.second), description, status)
+ return "<span class='notification_time'>%s</span> %s:
%s" % \
+ ("%s-%02d-%02d %02d:%02d:%02d" % (timestamp.year,
+ timestamp.month,
+ timestamp.day,
+ timestamp.hour,
+ timestamp.minute,
+ timestamp.second),
+ description, status)
def end(self):
log.debug("Ending %s", self.task)
@@ -229,6 +236,9 @@
# set by an ObjectTask or Task on failure
# (see Task.invoke() and Task.exception() above)
# Previously the different mechanisms produced different results.
+ if not status_code in (0,"OK"):
+ status_code = Exception(status_code)
+
if isinstance(status_code, Exception):
self.status = self.FAILED
self.exception = status_code
Show replies by date