Skip to content

Commit 0ea270d

Browse files
Create a temproary directory for all submission files.
This way they can be called whatever is desired and there will be no overlap. i.e. can have runscript.sh without the random hash from TemporaryNamedFile. modified: productionsystem/sql/models/ParametricJobs.py
1 parent f5e2e05 commit 0ea270d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

productionsystem/sql/models/ParametricJobs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,12 @@ def _setup_dirac_job(self, DiracJob, tmp_runscript, tmp_filemanager):
118118
def submit(self):
119119
"""Submit parametric job."""
120120
with dirac_api_job_client() as (dirac, dirac_job_class),\
121-
TemporyFileManagerContext() as tmp_filemanager:
121+
TemporyFileManagerContext() as tmp_filemanager,\
122+
open(os.path.join(tmp_filemanager.new_dir(), "runscript.sh"), "w") as tmp_runscript:
123+
os.chmod(tmp_runscript.name, 0o755)
122124
try:
123125
dirac_jobs = self._setup_dirac_job(dirac_job_class,
124-
tmp_filemanager.new_file(mode="w",
125-
permissions=0o755,
126-
prefix="jobscript_",
127-
suffix=".sh"),
126+
tmp_runscript,
128127
tmp_filemanager)
129128
except Exception as err:
130129
self.logger.exception("Error setting up the parametric job %d.%d: %s",

0 commit comments

Comments
 (0)