Add custom logging setup for daemons
[ganeti-local] / lib / jqueue.py
index b0b8916..e50eba8 100644 (file)
@@ -38,13 +38,15 @@ class JobObject:
     self.data = jdesc
     jdesc.status = opcodes.Job.STATUS_PENDING
     jdesc.job_id = jid
+    jdesc.op_status = [opcodes.Job.STATUS_PENDING for i in jdesc.op_list]
+    jdesc.op_result = [None for i in jdesc.op_list]
     self.lock = threading.Lock()
 
   def SetStatus(self, status, result=None):
     self.lock.acquire()
     self.data.status = status
     if result is not None:
-      self.data.result = result
+      self.data.op_result = result
     self.lock.release()
 
   def GetData(self):
@@ -114,8 +116,12 @@ class QueueManager:
             row.append(jdata.job_id)
           elif fname == "status":
             row.append(jdata.status)
-          elif fname == "opcodes":
-            row.append(",".join([op.OP_ID for op in jdata.op_list]))
+          elif fname == "op_list":
+            row.append([op.__getstate__() for op in jdata.op_list])
+          elif fname == "op_status":
+            row.append(jdata.op_status)
+          elif fname == "op_result":
+            row.append(jdata.op_result)
           else:
             raise errors.OpExecError("Invalid job query field '%s'" %
                                            fname)