Skip to content

Commit

Permalink
expand local filename
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Oct 9, 2024
1 parent 5031dd7 commit 90f7277
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions iceprod/core/exe.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,10 @@ def _add_input_files(self, files, f=None):
if data.transfer is Transfer.FALSE:
continue
if data.url.startswith('gsiftp://'):
python_cmd = f'from iceprod.core.gridftp import GridFTP\nGridFTP.get("{data.url}", filename="$PWD/{data.local}")'
cmd = [
'/cvmfs/icecube.opensciencegrid.org/iceprod/v2.7.1/env-shell.sh',
'python -c',
f"""'from iceprod.core.gridftp import GridFTP;GridFTP.get("{data.url}",filename="{data.local}")'""",
'python', '-', "<<____HERE\n" + python_cmd + '\n____HERE\n',
]
print(f'# Input: {data}', file=f)
print(' '.join(cmd), file=f)
Expand All @@ -407,15 +407,15 @@ def _add_output_files(self, files, f=None):
if data.transfer is Transfer.FALSE:
continue
if data.url.startswith('gsiftp://'):
python_cmd = f'from iceprod.core.gridftp import GridFTP\nGridFTP.put("{data.url}", filename="$PWD/{data.local}")'
cmd_core = [
'/cvmfs/icecube.opensciencegrid.org/iceprod/v2.7.1/env-shell.sh',
'python -c',
f"""'from iceprod.core.gridftp import GridFTP;GridFTP.put("{data.url}",filename="{data.local}")'""",
'python', '-', "<<____HERE\n" + python_cmd + '\n____HERE\n',
]
if data.transfer is Transfer.MAYBE:
cmd = [f'if [ -f {data.local} ]; then ']
cmd = [f'if [ -f {data.local} ]; then\n']
cmd.extend(cmd_core)
cmd += ['; fi']
cmd += ['fi']
else:
cmd = cmd_core
print(f'# Output: {data}', file=f)
Expand Down

0 comments on commit 90f7277

Please sign in to comment.