Author: tmckay Date: 2011-08-16 16:04:54 +0000 (Tue, 16 Aug 2011) New Revision: 4933
Modified: trunk/cumin/python/cumin/grid/job.py Log: When Cumin requests a job output file from condor, prepend the value of the Iwd classad attribute to the filename if the filename does not begin with "/" BZ731065
Modified: trunk/cumin/python/cumin/grid/job.py =================================================================== --- trunk/cumin/python/cumin/grid/job.py 2011-08-16 15:31:16 UTC (rev 4932) +++ trunk/cumin/python/cumin/grid/job.py 2011-08-16 16:04:54 UTC (rev 4933) @@ -917,9 +917,20 @@ return fmt_datetime(now, sec=True)
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 not filename.startswith("/"): + if not path.endswith("/"): + path += "/" + filename = path + filename + return filename + out_file = None user_file = None err_file = None + iwd = None
ads, error = self.do_get_items(session) for ad in ads: @@ -929,7 +940,16 @@ user_file = ad['value'] elif ad['name'] == "Err": err_file = ad['value'] + elif ad['name'] == "Iwd": + # Save working directory for path + # extension on the above files... + iwd = ad['value']
+ if iwd is not None: + out_file = add_path(iwd, out_file) + err_file = add_path(iwd, err_file) + user_file = add_path(iwd, user_file) + # set title for radiotab so mouseover will display file name self.which_file.set_file_name(session, "o", out_file) self.which_file.set_file_name(session,"e", err_file)
cumin-developers@lists.fedorahosted.org