Skip to content

Commit

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

This reverts commit fc50785.
  • Loading branch information
Thanayut Seethongchuen committed Jul 26, 2023
1 parent 1ebaa01 commit 6161506
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions scripts/CMSRunAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,19 +399,11 @@ def prepSandbox(opts):
print(f"==== Sandbox untarring STARTING at {UTCNow()} ====")

#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(f"==== Sandbox untarring FINISHED at {UTCNow()} ====")



def extractUserSandbox(archiveJob, cmsswVersion):
# the user sandbox contains the user scram directory files and thus
# is unpacked in the local CMSSW_X_Y_X dir, but the cmsRun command
Expand All @@ -421,6 +413,12 @@ def extractUserSandbox(archiveJob, cmsswVersion):
print(subprocess.getoutput(f"tar xfm {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='', scramTool=None):
Expand Down

0 comments on commit 6161506

Please sign in to comment.