Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WorkloadManagementSystem/JobWrapper/JobWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def initialize(self, arguments):
os.mkdir(str(self.jobID))
os.chdir(str(self.jobID))
extraOpts = self.jobArgs.get('ExtraOptions', '')
if extraOpts:
if extraOpts and '$DIRACROOT' in self.jobArgs.get('Executable', '').strip():
if os.path.exists('%s/%s' % (self.root, extraOpts)):
shutil.copyfile('%s/%s' % (self.root, extraOpts), extraOpts)
self.__loadLocalCFGFiles(self.localSiteRoot)
Expand Down
5 changes: 5 additions & 0 deletions WorkloadManagementSystem/Utilities/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import sys
import json
import six

from DIRAC import gConfig, gLogger, S_OK
from DIRAC.Core.Utilities.File import mkDir
Expand All @@ -17,6 +18,8 @@ def createJobWrapper(jobID, jobParams, resourceParams, optimizerParams,
""" This method creates a job wrapper filled with the CE and Job parameters to execute the job.
Main user is the JobAgent
"""
if isinstance(extraOptions, six.string_types) and extraOptions.endswith('.cfg'):
extraOptions = '--cfg %s' % extraOptions

arguments = {'Job': jobParams,
'CE': resourceParams,
Expand Down Expand Up @@ -78,6 +81,8 @@ def createRelocatedJobWrapper(wrapperPath, rootLocation,
""" This method creates a job wrapper for a specific job in wrapperPath,
but assumes this has been reloated to rootLocation before running it.
"""
if isinstance(extraOptions, six.string_types) and extraOptions.endswith('.cfg'):
extraOptions = '--cfg %s' % extraOptions

arguments = {'Job': jobParams,
'CE': resourceParams,
Expand Down