Skip to content

Commit

Permalink
RESTCache,py - pylint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mapellidario committed Sep 25, 2023
1 parent cce4910 commit a389d29
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python/CRABInterface/RESTCache.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def get(self, subresource, objecttype, taskname, username, tarballname): # pyli
# need to build a single URL string to return
preSignedUrl = response
except ClientError as e:
raise ExecutionError("Connection to s3.cern.ch failed:\n%s" % str(e))
raise ExecutionError(f"Connection to s3.cern.ch failed:\n{str(e)}") from e
# somehow it does not work to return preSignedUrl as a single object
return [preSignedUrl['url'], preSignedUrl['fields']]

Expand All @@ -176,7 +176,7 @@ def get(self, subresource, objecttype, taskname, username, tarballname): # pyli
ExpiresIn=expiration)
preSignedUrl = response
except ClientError as e:
raise ExecutionError("Connection to s3.cern.ch failed:\n%s" % str(e))
raise ExecutionError(f"Connection to s3.cern.ch failed:\n{str(e)}") from e
return preSignedUrl

if subresource == 'retrieve':
Expand All @@ -187,7 +187,7 @@ def get(self, subresource, objecttype, taskname, username, tarballname): # pyli
with MeasureTime(self.logger, modulename=__name__, label="get.retrieve.download_file") as _:
self.s3_client.download_file(self.s3_bucket, s3_objectKey, tempFile)
except ClientError as e:
raise ExecutionError("Connection to s3.cern.ch failed:\n%s" % str(e))
raise ExecutionError(f"Connection to s3.cern.ch failed:\n{str(e)}") from e
with open(tempFile) as f:
txt = f.read()
os.remove(tempFile)
Expand Down

0 comments on commit a389d29

Please sign in to comment.