From 8ffdc93e84f8bb06876dfc0378c650fe5b952ebc Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Thu, 17 Nov 2022 22:03:53 -0100 Subject: [PATCH] Techdebt: Replace string-format with f-strings (for g* dirs) (#5681) --- moto/glacier/responses.py | 4 +--- moto/glue/exceptions.py | 12 ++++++------ 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/moto/glacier/responses.py b/moto/glacier/responses.py index 0219fdea9..b32f5e0c1 100644 --- a/moto/glacier/responses.py +++ b/moto/glacier/responses.py @@ -132,9 +132,7 @@ class GlacierResponse(BaseResponse): vault_name, job_type, tier, archive_id ) headers["x-amz-job-id"] = job_id - headers["Location"] = "/{0}/vaults/{1}/jobs/{2}".format( - account_id, vault_name, job_id - ) + headers["Location"] = f"/{account_id}/vaults/{vault_name}/jobs/{job_id}" return 202, headers, "" def vault_jobs_individual_response(self, request, full_url, headers): diff --git a/moto/glue/exceptions.py b/moto/glue/exceptions.py index c678ce011..2e9c9ca0d 100644 --- a/moto/glue/exceptions.py +++ b/moto/glue/exceptions.py @@ -7,7 +7,7 @@ class GlueClientError(JsonRESTError): class AlreadyExistsException(GlueClientError): def __init__(self, typ): - super().__init__("AlreadyExistsException", "%s already exists." % (typ)) + super().__init__("AlreadyExistsException", f"{typ} already exists.") class DatabaseAlreadyExistsException(AlreadyExistsException): @@ -37,12 +37,12 @@ class EntityNotFoundException(GlueClientError): class DatabaseNotFoundException(EntityNotFoundException): def __init__(self, db): - super().__init__("Database %s not found." % db) + super().__init__(f"Database {db} not found.") class TableNotFoundException(EntityNotFoundException): def __init__(self, tbl): - super().__init__("Table %s not found." % tbl) + super().__init__(f"Table {tbl} not found.") class PartitionNotFoundException(EntityNotFoundException): @@ -52,17 +52,17 @@ class PartitionNotFoundException(EntityNotFoundException): class CrawlerNotFoundException(EntityNotFoundException): def __init__(self, crawler): - super().__init__("Crawler %s not found." % crawler) + super().__init__(f"Crawler {crawler} not found.") class JobNotFoundException(EntityNotFoundException): def __init__(self, job): - super().__init__("Job %s not found." % job) + super().__init__(f"Job {job} not found.") class JobRunNotFoundException(EntityNotFoundException): 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):