Author: justi9
Date: 2010-08-26 14:13:59 -0400 (Thu, 26 Aug 2010)
New Revision: 4228
Modified:
mgmt/newdata/cumin/python/cumin/grid/submission.py
Log:
Don't drop extra attributes that evaluate to false; add logging for submitted job ads
Modified: mgmt/newdata/cumin/python/cumin/grid/submission.py
===================================================================
--- mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-26 14:39:22 UTC (rev 4227)
+++ mgmt/newdata/cumin/python/cumin/grid/submission.py 2010-08-26 18:13:59 UTC (rev 4228)
@@ -212,8 +212,7 @@
put("Err", stderr)
put("UserLog", usrlog)
- for name, value in attrs.items():
- put(name, value)
+ ad.update(attrs)
descriptors = dict()
descriptors["Requirements"] = "com.redhat.grid.Expression"
@@ -222,6 +221,8 @@
invoc.description = "Submit job '%s'" % description
+ log_job_ad(ad)
+
self.qmf_call(invoc, scheduler, "SubmitJob", ad)
class JobSubmitForm(ObjectTaskForm):
@@ -452,9 +453,6 @@
"JobVMMemory, " + \
"ImageSize / 1024.000000))"
- for name, value in attrs.items():
- ad[name] = value
-
# VM
ad["VMPARAM_Kvm_Disk"] = "%s:vda:w" % image
@@ -481,6 +479,10 @@
ad["Requirements"] = " && ".join(exprs)
+ # Extra attributes
+
+ ad.update(attrs)
+
# Descriptors
descriptors = dict()
@@ -492,6 +494,8 @@
invoc.description = "Submit VM job '%s'" % description
+ log_job_ad(ad)
+
self.qmf_call(invoc, scheduler, "SubmitJob", ad)
class VmJobSubmitForm(ObjectTaskForm):
@@ -598,6 +602,8 @@
ad["Environment"] = " ".join(vars)
+ ad.update(attrs)
+
descriptors = dict()
descriptors["Requirements"] = "com.redhat.grid.Expression"
descriptors["OnExitRemove"] = "com.redhat.grid.Expression"
@@ -606,6 +612,8 @@
invoc.description = "Submit DAG job '%s'" % description
+ log_job_ad(ad)
+
self.qmf_call(invoc, scheduler, "SubmitJob", ad)
class DagJobSubmitForm(ObjectTaskForm):
@@ -654,3 +662,9 @@
class LocationField(StringField):
def render_title(self, session):
return "DAG file location"
+
+def log_job_ad(ad):
+ log.debug("Job ad:")
+
+ for item in sorted(ad.items()):
+ log.debug(" %-34s %r", *item)