[rhmessaging-commits] rhmessaging commits: r4188 - in mgmt/newdata/cumin/python/cumin: grid and 1 other directory.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Fri Aug 6 09:46:22 EDT 2010


Author: eallen
Date: 2010-08-06 09:46:22 -0400 (Fri, 06 Aug 2010)
New Revision: 4188

Modified:
   mgmt/newdata/cumin/python/cumin/grid/job.py
   mgmt/newdata/cumin/python/cumin/qmfadapter.py
Log:
Better fix for BZ 621678. The results from the GetJobSummaries call returns a dict. Use the dict's keys as the job ids.

Modified: mgmt/newdata/cumin/python/cumin/grid/job.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/job.py	2010-08-05 21:19:10 UTC (rev 4187)
+++ mgmt/newdata/cumin/python/cumin/grid/job.py	2010-08-06 13:46:22 UTC (rev 4188)
@@ -14,6 +14,7 @@
 from cumin.formats import *
 from cumin.util import *
 from cumin.qmfadapter import *
+from parsley.stringex import partition
 
 import main
 
@@ -106,24 +107,14 @@
         rows = self.process_results(results)
         return rows 
 
-    def process_record(self, record):
+    def process_record(self, key, record):
         field_data = list()
         for column in self.columns:
             try:
                 val = record[column.name]
             except KeyError:
                 if column.name == "JobId":
-                    if not "ClusterId" in record:
-                        try:
-                            gjid = record["GlobalJobId"]
-                            # mrg.lab.bos#cluster.prod#number
-                            parts = gjid.split("#")
-                            record["ClusterId"] = int(parts[1].split(".")[0])
-                        except:
-                            record["ClusterId"] = 0
-                    if not "ProcId" in record:
-                        record['ProcId'] = 0
-                    val = "%d.%d" % (record['ClusterId'], record['ProcId'])
+                    val = key
                 else:
                     val = 0
             field_data.append(val)

Modified: mgmt/newdata/cumin/python/cumin/qmfadapter.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/qmfadapter.py	2010-08-05 21:19:10 UTC (rev 4187)
+++ mgmt/newdata/cumin/python/cumin/qmfadapter.py	2010-08-06 13:46:22 UTC (rev 4188)
@@ -41,12 +41,12 @@
 
         if results:
             for key in results:
-                row = self.process_record(results[key])
+                row = self.process_record(key, results[key])
                 records.append(row)
 
         return records
 
-    def process_record(self, record):
+    def process_record(self, key, record):
         field_data = list()
         for column in self.columns:
             try:



More information about the rhmessaging-commits mailing list