Skip to content
Open
Changes from 3 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
16 changes: 15 additions & 1 deletion src/DIRAC/WorkloadManagementSystem/JobWrapper/JobWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,17 @@ def __transferOutputDataFiles(self, outputData, outputSE, outputPath):
else:
nonlfnList.append(out)

# Check whether list of outputData has a globbable pattern
# Check whether the list of LFNs has globbable patterns
globbedLfnList = []
for lfn in lfnList:
lfnPath = os.path.dirname(lfn)
lfnLocal = os.path.basename(lfn)
globbedLfnList += [os.path.join(lfnPath, gLfn) for gLfn in List.uniqueElements(getGlobbedFiles(lfnLocal))]
if globbedLfnList != lfnList and globbedLfnList:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more precise:

Suggested change
if globbedLfnList != lfnList and globbedLfnList:
if globbedLfnList and globbedLfnList != lfnList:

self.log.info("Found a pattern in the output data LFN list, LFNs to upload are:", ", ".join(globbedLfnList))
lfnList = globbedLfnList

# Check whether the list of outputData has a globbable pattern
Comment on lines +954 to +964

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a code duplication between these inserted lines and those that follow, care to refactor for simplicity?

globbedOutputList = List.uniqueElements(getGlobbedFiles(nonlfnList))
if globbedOutputList != nonlfnList and globbedOutputList:
self.log.info(
Expand Down Expand Up @@ -1113,6 +1123,10 @@ def __getLFNfromOutputFile(self, outputFile, outputPath=""):
# If output path is given, append it to the user path and put output files in this directory
if outputPath.startswith("/"):
outputPath = outputPath[1:]
# If output path is given with the LFN: prefix, take it as an absolute path
elif outputPath.startswith("LFN:"):
outputPath = outputPath[4:]
basePath = ""
Comment on lines +1126 to +1129

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this block be before the previous 2 lines? For the case when outputPath == "LFN:/some/where/some/thing.xyz"

else:
# By default the output path is constructed from the job id
subdir = str(int(self.jobID / 1000))
Expand Down
Loading