Skip to content

Commit d11f0be

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix bad i18n and fstrings interaction with flake8" into stable/2025.1
2 parents c3be83f + 4c780e7 commit d11f0be

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

neutron/agent/metadata/agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ def handle(self):
172172
network_id, router_id = self._get_instance_id(req)
173173
if network_id and router_id:
174174
title = '400 Bad Request'
175-
msg = _(f'Both network {network_id} and router {router_id} '
176-
f'defined.')
175+
msg = _('Both network %s and router %s '
176+
'defined.') % (network_id, router_id)
177177
elif network_id:
178178
title = '404 Not Found'
179-
msg = _(f'Instance was not found on network {network_id}.')
179+
msg = _('Instance was not found on network %s.') % network_id
180180
LOG.warning(msg)
181181
else:
182182
title = '404 Not Found'
183-
msg = _(f'Instance was not found on router {router_id}.')
183+
msg = _('Instance was not found on router %s.') % router_id
184184
LOG.warning(msg)
185185
res = common_metadata.encode_http_reponse(title, title, msg)
186186
self.wfile.write(res)

neutron/agent/ovn/metadata/server_socket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,15 @@ def handle(self):
148148
network_id, router_id = self._get_instance_id(req)
149149
if network_id and router_id:
150150
title = '400 Bad Request'
151-
msg = _(f'Both network {network_id} and router {router_id} '
152-
f'defined.')
151+
msg = _('Both network %s and router %s '
152+
'defined.') % (network_id, router_id)
153153
elif network_id:
154154
title = '404 Not Found'
155-
msg = _(f'Instance was not found on network {network_id}.')
155+
msg = _('Instance was not found on network %s.') % network_id
156156
LOG.warning(msg)
157157
else:
158158
title = '404 Not Found'
159-
msg = _(f'Instance was not found on router {router_id}.')
159+
msg = _('Instance was not found on router %s.') % router_id
160160
LOG.warning(msg)
161161
res = common_metadata.encode_http_reponse(title, title, msg)
162162
self.wfile.write(res)

0 commit comments

Comments
 (0)