Skip to content

Commit

Permalink
Merge pull request cms-sw#701 from clelange/QuickFixEosTools
Browse files Browse the repository at this point in the history
fix regular expression and get pfn in createEOSDir
  • Loading branch information
gpetruc authored Jun 22, 2017
2 parents 725b16a + dd02294 commit 54706af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions PhysicsTools/HeppyCore/python/utils/eostools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

def splitPFN(pfn):
"""Split the PFN in to { <protocol>, <host>, <path>, <opaque> }"""
groups = re.match("^(\w\+)://([^/]+)/(/[^?]+)(\?.*)?", pfn)
groups = re.match("^(\w+)://([^/]+)/(/[^?]+)(\?.*)?", pfn)
if not groups: raise RuntimeError, "Malformed pfn: '%s'" % pfn
return (groups.group(1), groups.group(2), groups.group(3), groups.group(4))

Expand Down Expand Up @@ -190,10 +190,10 @@ def createEOSDir( path ):
???Will, I'm quite worried by the fact that if this path already exists, and is
a file, everything will 'work'. But then we have a file, and not a directory,
while we expect a dir..."""
lfn = eosToLFN(path)
if not isEOSFile(lfn):
pfn = lfnToPFN(path)
if not isEOSFile(pfn):
# if not isDirectory(lfn):
runEOSCommand(lfn,'mkdir','-p')
runEOSCommand(pfn,'mkdir','-p')
if isDirectory(path):
return path
else:
Expand Down

0 comments on commit 54706af

Please sign in to comment.