Author: tmckay
Date: 2011-09-16 20:21:36 +0000 (Fri, 16 Sep 2011)
New Revision: 4981
Modified:
trunk/cumin/python/cumin/grid/job.py
trunk/cumin/python/cumin/grid/submission.py
Log:
Prepend the working directory path to input, output, error, and log file
names on job submission if the files are specified and do not already give
absolute paths. This will allow Aviary to have the proper information for
a lookup if/when files are requested.
BZ731065
Modified: trunk/cumin/python/cumin/grid/job.py
===================================================================
--- trunk/cumin/python/cumin/grid/job.py 2011-09-16 19:52:21 UTC (rev 4980)
+++ trunk/cumin/python/cumin/grid/job.py 2011-09-16 20:21:36 UTC (rev 4981)
@@ -1,4 +1,5 @@
import logging
+import os
from datetime import datetime
from cumin.objectframe import ObjectView, ObjectFrameTaskForm, ObjectFrame,\
@@ -948,13 +949,8 @@
def do_process(self, session):
def add_path(path, filename):
- # If filename does not begin with an absolute
- # path, prepend the path value to filename
- if filename is not None and \
- not filename.startswith("/"):
- if not path.endswith("/"):
- path += "/"
- filename = path + filename
+ if path is not None and filename not in (None, ""):
+ return os.path.join(path, filename)
return filename
out_file = None
Modified: trunk/cumin/python/cumin/grid/submission.py
===================================================================
--- trunk/cumin/python/cumin/grid/submission.py 2011-09-16 19:52:21 UTC (rev 4980)
+++ trunk/cumin/python/cumin/grid/submission.py 2011-09-16 20:21:36 UTC (rev 4981)
@@ -330,6 +330,19 @@
request_mem_MB=None,
request_disk_KB=None,
attrs={}):
+
+ def add_path(path, filename):
+ if path is not None and filename not in (None, ""):
+ return os.path.join(path, filename)
+ return filename
+
+ # fixup paths for in, out, err, log
+ if iwd is not None:
+ stdin = add_path(iwd, stdin)
+ stdout = add_path(iwd, stdout)
+ stderr = add_path(iwd, stderr)
+ usrlog = add_path(iwd, usrlog)
+
ad = dict()
ad["Submission"] = description
Show replies by date