Bump pyupgrade target to 3.10+

... according to the versions currently supported.
Change-Id: I688606852b0d9cc61c53f94f5bad7424f5882917
Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
Takashi Kajinami
2025年10月05日 19:58:50 +09:00
parent e8395581c1
commit 323e5a6d63

View File

@@ -27,4 +27,4 @@ repos:
rev:v3.20.0
hooks:
- id:pyupgrade
args:[--py3-only]
args:[--py310-plus]

View File

@@ -33,7 +33,7 @@ class ClientException(Exception):
formatted_string = "{} (HTTP {})".format(
self.message, self.http_status)
if self.request_id:
formatted_string += " (Request-ID: {})".format(self.request_id)
formatted_string += f" (Request-ID: {self.request_id})"
return formatted_string

View File

@@ -60,13 +60,13 @@ class AodhClientTest(base.ClientTestBase):
self.assertEqual("another-name",
self.details_multiple(result)[0]['name'])
params = "update --name {}{}".format(name, alarm_id)
params = f"update --name {name}{alarm_id}"
result = self.aodh('alarm', params=params)
self.assertEqual(name,
self.details_multiple(result)[0]['name'])
# Check update with no change is allowed
params = "update --name {}{}".format(name, name)
params = f"update --name {name}{name}"
result = self.aodh('alarm', params=params)
self.assertEqual(name,
self.details_multiple(result)[0]['name'])

View File

@@ -103,14 +103,14 @@ def format_string_list(objs, field):
def format_dict_list(objs, field):
objs[field] = "\n".join(
"- " + ", ".join("{}: {}".format(k, v)
"- " + ", ".join(f"{k}: {v}"
for k, v in elem.items())
for elem in objs[field])
def format_move_dict_to_root(obj, field):
for attr in obj[field]:
obj["{}/{}".format(field, attr)] = obj[field][attr]
obj[f"{field}/{attr}"] = obj[field][attr]
del obj[field]
@@ -142,7 +142,7 @@ def dict_from_parsed_args(parsed_args, attrs):
def dict_to_querystring(objs):
return "&".join(["{}={}".format(k, v)
return "&".join([f"{k}={v}"
for k, v in objs.items()
if v is not None])

View File

@@ -26,7 +26,7 @@ class AlarmManager(base.Manager):
def _filtersdict_to_url(filters):
urls = []
for k, v in sorted(filters.items()):
url = "q.field={}&q.op=eq&q.value={}".format(k, v)
url = f"q.field={k}&q.op=eq&q.value={v}"
urls.append(url)
return '&'.join(urls)

View File

@@ -37,7 +37,7 @@ class AlarmHistoryManager(base.Manager):
pagination = utils.get_pagination_options(limit, marker, sorts)
url = self.url % alarm_id
if pagination:
url = "{}?{}".format(url, pagination)
url = f"{url}?{pagination}"
return self._get(url).json()
def search(self, query=None):

View File

@@ -21,7 +21,7 @@ class QuotasManager(base.Manager):
def list(self, project=None):
url = self.base_url
if project:
url = "{}?project_id={}".format(url, project)
url = f"{url}?project_id={project}"
return self._get(url).json()

View File

@@ -25,7 +25,7 @@ def gen_ref(ver, title, names):
refdir = os.path.join(BASE_DIR, "ref")
pkg = "aodhclient"
if ver:
pkg = "{}.{}".format(pkg, ver)
pkg = f"{pkg}.{ver}"
refdir = os.path.join(refdir, ver)
if not os.path.exists(refdir):
os.makedirs(refdir)
Reference in New Issue
openstack/python-aodhclient
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.