Update target python version for pyupgrade
Python <= 3.10 is no longer supported. Change-Id: Iac5eb29de921764afccf006618b03eede6c89235 Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
1 parent
c5127c1549
commit
4676c9f306
7 files changed
+11
-11
No files matched your search
@@ -29,4 +29,4 @@ repos:
|
||||
rev: v3.21.2
|
||||
hooks:
|
||||
- id: pyupgrade
|
||||
args: [--py3-only]
|
||||
args: [--py311-plus]
|
||||
@@ -56,7 +56,7 @@ def image_field_data(request, include_empty_option=False):
|
||||
images.sort(key=lambda c: c.name)
|
||||
images_list = []
|
||||
for image in images:
|
||||
image_label = "{} ({})".format(image.name, filesizeformat(image.size))
|
||||
image_label = f"{image.name} ({filesizeformat(image.size)})"
|
||||
images_list.append((image.id, image_label))
|
||||
|
||||
if not images:
|
||||
|
||||
@@ -136,7 +136,7 @@ def stack_output(output):
|
||||
parts = urlparse.urlsplit(output)
|
||||
if parts.netloc and parts.scheme in ('http', 'https'):
|
||||
url = html.escape(output)
|
||||
safe_link = '<a href="{}" target="_blank">{}</a>'.format(url, url)
|
||||
safe_link = f'<a href="{url}" target="_blank">{url}</a>'
|
||||
return safestring.mark_safe(safe_link)
|
||||
if isinstance(output, dict) or isinstance(output, list):
|
||||
output = json.dumps(output, indent=2)
|
||||
|
||||
@@ -342,7 +342,7 @@ class ResourcesUpdateRow(tables.Row):
|
||||
def get_data(self, request, resource_name):
|
||||
try:
|
||||
stack = self.table.stack
|
||||
stack_identifier = '{}/{}'.format(stack.stack_name, stack.id)
|
||||
stack_identifier = f'{stack.stack_name}/{stack.id}'
|
||||
# return api.heat.resource_get(
|
||||
# request, stack_identifier, resource_name)
|
||||
return api.heat.resource_get(request,
|
||||
|
||||
@@ -99,7 +99,7 @@ class StackEventsTab(tabs.TableTab):
|
||||
|
||||
def get_events_data(self):
|
||||
stack = self.tab_group.kwargs['stack']
|
||||
stack_identifier = '{}/{}'.format(stack.stack_name, stack.id)
|
||||
stack_identifier = f'{stack.stack_name}/{stack.id}'
|
||||
prev_marker = self.request.GET.get(
|
||||
project_tables.EventsTable._meta.prev_pagination_param)
|
||||
if prev_marker is not None:
|
||||
@@ -156,7 +156,7 @@ class StackResourcesTab(tabs.Tab):
|
||||
def get_context_data(self, request):
|
||||
stack = self.tab_group.kwargs['stack']
|
||||
try:
|
||||
stack_identifier = '{}/{}'.format(stack.stack_name, stack.id)
|
||||
stack_identifier = f'{stack.stack_name}/{stack.id}'
|
||||
resources = api.heat.resources_list(self.request, stack_identifier)
|
||||
LOG.debug('got resources %s', resources)
|
||||
# The stack id is needed to generate the resource URL.
|
||||
|
||||
@@ -239,7 +239,7 @@ class TestCase(horizon_helpers.TestCase):
|
||||
if message and message not in str(errors):
|
||||
self.fail(
|
||||
"Expected message not found, instead found: %s"
|
||||
% ["{}: {}".format(key, [e for e in field_errors]) for
|
||||
% [f"{key}: {[e for e in field_errors]}" for
|
||||
(key, field_errors) in errors.items()])
|
||||
else:
|
||||
assert len(errors) > 0, "No errors were found on the form"
|
||||
|
||||
@@ -412,17 +412,17 @@ def data(TEST):
|
||||
'AWS::StackId': (
|
||||
'arn:openstack:heat::2ce287:stacks/teststack/88553ec'),
|
||||
'DBRootPassword': '******',
|
||||
'AWS::StackName': "teststack{}".format(i),
|
||||
'AWS::StackName': f"teststack{i}",
|
||||
'DBPassword': '******',
|
||||
'AWS::Region': 'ap-southeast-1',
|
||||
'DBName': 'wordpress'
|
||||
},
|
||||
"stack_status_reason": "Stack successfully created",
|
||||
"stack_name": "stack-test{}".format(i),
|
||||
"stack_name": f"stack-test{i}",
|
||||
"creation_time": "2013-04-22T00:11:39Z",
|
||||
"updated_time": "2013-04-22T00:11:39Z",
|
||||
"stack_status": "CREATE_COMPLETE",
|
||||
"id": "05b4f39f-ea96-4d91-910c-e758c078a089{}".format(i)
|
||||
"id": f"05b4f39f-ea96-4d91-910c-e758c078a089{i}"
|
||||
}
|
||||
stack = stacks.Stack(stacks.StackManager(None), stack_data)
|
||||
TEST.stacks.add(stack)
|
||||
@@ -492,7 +492,7 @@ def data(TEST):
|
||||
|
||||
"creation_time": "2016-02-21T04:02:54",
|
||||
"status_reason": "Stack SNAPSHOT completed successfully",
|
||||
"id": "01558a3b-ba05-4427-bbb4-1e4ab71cfca{}".format(i)
|
||||
"id": f"01558a3b-ba05-4427-bbb4-1e4ab71cfca{i}"
|
||||
}
|
||||
TEST.stack_snapshot.add(snapshot_data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user