Skip to content

Commit

Permalink
expand user tar files in /srv . Correct fix for dmwm#7661
Browse files Browse the repository at this point in the history
  • Loading branch information
belforte committed Jun 30, 2023
1 parent 2c31e26 commit fb4b769
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/CMSRunAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,17 @@ def parseArgs():
return opts

def prepSandbox(opts):
print("==== Sandbox untarring STARTING at %s ====" % time.asctime(time.gmtime()))
print("==== Sandbox untarring in job's top dir STARTING at %s ====" % time.asctime(time.gmtime()))

#The user sandbox.tar.gz has to be unpacked no matter what (even in DEBUG mode)
print(subprocess.getoutput('tar xfm %s' % opts.archiveJob))
# if the sandbox contains tar files, expand them
files = subprocess.getoutput(f"tar tf {opts.archiveJob}").split('\n')
for file in files:
if ('.tar.' in file) or file.endswith('.tar') or\
file.endswith('.tgz') or file.endswith('.tbz'):
print(subprocess.getoutput(f"tar xvfm {file}"))

print("==== Sandbox untarring FINISHED at %s ====" % time.asctime(time.gmtime()))

#move the pset in the right place
Expand All @@ -413,12 +420,6 @@ def extractUserSandbox(archiveJob, cmsswVersion):
print(subprocess.getoutput('tar xfm %s ' % os.path.join('..', archiveJob)))
os.rename('PSet.py', '../PSet.py')
os.rename('PSet.pkl', '../PSet.pkl')
# if the sandbox contains tar files, expand them
files = subprocess.getoutput(f"tar tf ../{archiveJob}").split('\n')
for file in files:
if ('.tar.' in file) or file.endswith('.tar') or\
file.endswith('.tgz') or file.endswith('.tbz'):
print(subprocess.getoutput(f"tar xfm {file}"))
os.chdir('..')

def getProv(filename, scram):
Expand Down

0 comments on commit fb4b769

Please sign in to comment.