Skip to content

Commit

Permalink
expand user tar files in /srv . Correct fix for dmwm#7661 (dmwm#7708)
Browse files Browse the repository at this point in the history
* expand user tar files in /srv . Correct fix for dmwm#7661

* final cleanup
  • Loading branch information
belforte committed Jul 7, 2023
1 parent 20373c1 commit 0419b24
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions scripts/CMSRunAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,19 @@ 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(f"expanding {opts.archiveJob} in {os.getcwd()}")
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(f"expanding {file} in {os.getcwd()}")
print(subprocess.getoutput(f"tar xfm {file}"))

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

#move the pset in the right place
Expand All @@ -413,12 +422,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 0419b24

Please sign in to comment.