Skip to content

Commit

Permalink
Merge pull request #54 from alexanderrichards/submission_tmp_dir
Browse files Browse the repository at this point in the history
Create a temproary directory for all submission files.
  • Loading branch information
alexanderrichards authored Jul 17, 2019
2 parents f5e2e05 + 0ea270d commit 51a6659
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions productionsystem/sql/models/ParametricJobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ def _setup_dirac_job(self, DiracJob, tmp_runscript, tmp_filemanager):
def submit(self):
"""Submit parametric job."""
with dirac_api_job_client() as (dirac, dirac_job_class),\
TemporyFileManagerContext() as tmp_filemanager:
TemporyFileManagerContext() as tmp_filemanager,\
open(os.path.join(tmp_filemanager.new_dir(), "runscript.sh"), "w") as tmp_runscript:
os.chmod(tmp_runscript.name, 0o755)
try:
dirac_jobs = self._setup_dirac_job(dirac_job_class,
tmp_filemanager.new_file(mode="w",
permissions=0o755,
prefix="jobscript_",
suffix=".sh"),
tmp_runscript,
tmp_filemanager)
except Exception as err:
self.logger.exception("Error setting up the parametric job %d.%d: %s",
Expand Down

0 comments on commit 51a6659

Please sign in to comment.