From 1ae68b9bb30d7bcd1bec4c7f20eba5991ba450f8 Mon Sep 17 00:00:00 2001 From: stamparm Date: Wed, 10 Jul 2013 17:18:09 +0200 Subject: [PATCH] Update for an Issue #405 (fix for usage of old 'complete' data from previous runs) --- lib/utils/api.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/utils/api.py b/lib/utils/api.py index 43c27163c..d9b049080 100644 --- a/lib/utils/api.py +++ b/lib/utils/api.py @@ -187,8 +187,6 @@ class StdDbOut(object): def write(self, value, status=CONTENT_STATUS.IN_PROGRESS, content_type=None): if self.messagetype == "stdout": - insert = True - if content_type is None: if kb.partRun is not None: content_type = PART_RUN_CONTENT_TYPES.get(kb.partRun) @@ -205,14 +203,9 @@ class StdDbOut(object): if status == CONTENT_STATUS.COMPLETE: if len(output) > 0: for index in xrange(0, len(output)): - if output[index][1] == CONTENT_STATUS.COMPLETE: - insert = False - else: - conf.database_cursor.execute("DELETE FROM data WHERE id = ?", (output[index][0],)) + conf.database_cursor.execute("DELETE FROM data WHERE id = ?", (output[index][0],)) - if insert: - conf.database_cursor.execute("INSERT INTO data VALUES(NULL, ?, ?, ?, ?)", - (self.taskid, status, content_type, jsonize(value))) + conf.database_cursor.execute("INSERT INTO data VALUES(NULL, ?, ?, ?, ?)", (self.taskid, status, content_type, jsonize(value))) if kb.partRun: kb.partRun = None