Techdebt: Replace string-format with f-strings (for g* dirs) (#5681)

This commit is contained in:
Bert Blommers 2022-11-17 22:03:53 -01:00 committed by GitHub
parent 1a8ddc0f2b
commit 8ffdc93e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -132,9 +132,7 @@ class GlacierResponse(BaseResponse):
vault_name, job_type, tier, archive_id vault_name, job_type, tier, archive_id
) )
headers["x-amz-job-id"] = job_id headers["x-amz-job-id"] = job_id
headers["Location"] = "/{0}/vaults/{1}/jobs/{2}".format( headers["Location"] = f"/{account_id}/vaults/{vault_name}/jobs/{job_id}"
account_id, vault_name, job_id
)
return 202, headers, "" return 202, headers, ""
def vault_jobs_individual_response(self, request, full_url, headers): def vault_jobs_individual_response(self, request, full_url, headers):

View File

@ -7,7 +7,7 @@ class GlueClientError(JsonRESTError):
class AlreadyExistsException(GlueClientError): class AlreadyExistsException(GlueClientError):
def __init__(self, typ): def __init__(self, typ):
super().__init__("AlreadyExistsException", "%s already exists." % (typ)) super().__init__("AlreadyExistsException", f"{typ} already exists.")
class DatabaseAlreadyExistsException(AlreadyExistsException): class DatabaseAlreadyExistsException(AlreadyExistsException):
@ -37,12 +37,12 @@ class EntityNotFoundException(GlueClientError):
class DatabaseNotFoundException(EntityNotFoundException): class DatabaseNotFoundException(EntityNotFoundException):
def __init__(self, db): def __init__(self, db):
super().__init__("Database %s not found." % db) super().__init__(f"Database {db} not found.")
class TableNotFoundException(EntityNotFoundException): class TableNotFoundException(EntityNotFoundException):
def __init__(self, tbl): def __init__(self, tbl):
super().__init__("Table %s not found." % tbl) super().__init__(f"Table {tbl} not found.")
class PartitionNotFoundException(EntityNotFoundException): class PartitionNotFoundException(EntityNotFoundException):
@ -52,17 +52,17 @@ class PartitionNotFoundException(EntityNotFoundException):
class CrawlerNotFoundException(EntityNotFoundException): class CrawlerNotFoundException(EntityNotFoundException):
def __init__(self, crawler): def __init__(self, crawler):
super().__init__("Crawler %s not found." % crawler) super().__init__(f"Crawler {crawler} not found.")
class JobNotFoundException(EntityNotFoundException): class JobNotFoundException(EntityNotFoundException):
def __init__(self, job): def __init__(self, job):
super().__init__("Job %s not found." % job) super().__init__(f"Job {job} not found.")
class JobRunNotFoundException(EntityNotFoundException): class JobRunNotFoundException(EntityNotFoundException):
def __init__(self, job_run): def __init__(self, job_run):
super().__init__("Job run %s not found." % job_run) super().__init__(f"Job run {job_run} not found.")
class VersionNotFoundException(EntityNotFoundException): class VersionNotFoundException(EntityNotFoundException):