Skip to content

Commit

Permalink
Addressing pylint src comments
Browse files Browse the repository at this point in the history
  • Loading branch information
anpicci committed Oct 17, 2024
1 parent 560b439 commit 2947409
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/python/WMCore/Storage/Backends/GFAL2Impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ def createFinalPFN(self, pfn):
if pfn.startswith('file:'):
return pfn
elif os.path.isfile(pfn):
return "file://%s" % os.path.abspath(pfn)
return "file://{}".format(os.path.abspath(pfn))
elif pfn.startswith('/'):
return "file://%s" % os.path.abspath(pfn)
return "file://{}".format(os.path.abspath(pfn))
return pfn

def createSourceName(self, protocol, pfn):
Expand Down Expand Up @@ -74,7 +74,7 @@ def createRemoveFileCommand(self, pfn):
Command is interrupted if time expires before it finishes
"""
if os.path.isfile(pfn):
return "/bin/rm -f %s" % os.path.abspath(pfn)
return "/bin/rm -f {}".format(os.path.abspath(pfn))
else:
return self.removeCommand.format(self.createFinalPFN(pfn))

Expand Down Expand Up @@ -123,9 +123,7 @@ def createStageOutCommand(self, sourcePFN, targetPFN, options=None, checksums=No
:checksums: dict, collect checksums according to the algorithms saved as keys
"""


copyCommandDict = self.buildCopyCommandDict(sourcePFN, targetPFN, options, checksums)
#copyCommand = self.copyCommand % copyCommandDict
copyCommand = self.copyCommand.format_map(copyCommandDict)
result = "#!/bin/bash\n" + copyCommand

Expand Down Expand Up @@ -155,7 +153,7 @@ def createDebuggingCommand(self, sourcePFN, targetPFN, options=None, checksums=N
"""

copyCommandDict = self.buildCopyCommandDict(sourcePFN, targetPFN, options, checksums)
copyCommand = self.copyCommand % copyCommandDict
copyCommand = self.copyCommand.format_map(copyCommandDict)

result = "#!/bin/bash\n"
result += """
Expand Down Expand Up @@ -205,7 +203,7 @@ def removeFile(self, pfnToRemove):
CleanUp pfn provided
"""
if os.path.isfile(pfnToRemove):
command = "/bin/rm -f %s" % os.path.abspath(pfnToRemove)
command = "/bin/rm -f {}".format(os.path.abspath(pfnToRemove))
else:
command = self.removeCommand.format(self.createFinalPFN(pfnToRemove))
self.executeCommand(command)
Expand Down

0 comments on commit 2947409

Please sign in to comment.