Browse Source

Handle log message interpolation by the logger in network/

According to OpenStack Guideline[1], logged string message should be
interpolated by the logger.

[1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages
Related-Bug: #1596829

Change-Id: I17467d01420750c004fbbf2a07730fc2badd62b8
tags/3.9.0
Gábor Antal 2 years ago
parent
commit
c9b1c2ad96

+ 2
- 2
openstackclient/network/v2/network_segment.py View File

@@ -119,8 +119,8 @@ class DeleteNetworkSegment(command.Command):
119 119
             except Exception as e:
120 120
                 result += 1
121 121
                 LOG.error(_("Failed to delete network segment with "
122
-                            "ID '%(network_segment)s': %(e)s")
123
-                          % {'network_segment': network_segment, 'e': e})
122
+                            "ID '%(network_segment)s': %(e)s"),
123
+                          {'network_segment': network_segment, 'e': e})
124 124
 
125 125
         if result > 0:
126 126
             total = len(parsed_args.network_segment)

+ 2
- 2
openstackclient/network/v2/router.py View File

@@ -249,8 +249,8 @@ class DeleteRouter(command.Command):
249 249
             except Exception as e:
250 250
                 result += 1
251 251
                 LOG.error(_("Failed to delete router with "
252
-                          "name or ID '%(router)s': %(e)s")
253
-                          % {'router': router, 'e': e})
252
+                          "name or ID '%(router)s': %(e)s"),
253
+                          {'router': router, 'e': e})
254 254
 
255 255
         if result > 0:
256 256
             total = len(parsed_args.router)

+ 4
- 4
openstackclient/network/v2/security_group_rule.py View File

@@ -315,7 +315,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
315 315
             if parsed_args.src_group:
316 316
                 LOG.warning(
317 317
                     _("The %(old)s option is deprecated, "
318
-                      "please use %(new)s instead.") %
318
+                      "please use %(new)s instead."),
319 319
                     {'old': '--src-group', 'new': '--remote-group'},
320 320
                 )
321 321
         elif not (parsed_args.remote_ip is None and
@@ -326,7 +326,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
326 326
             if parsed_args.src_ip:
327 327
                 LOG.warning(
328 328
                     _("The %(old)s option is deprecated, "
329
-                      "please use %(new)s instead.") %
329
+                      "please use %(new)s instead."),
330 330
                     {'old': '--src-ip', 'new': '--remote-ip'},
331 331
                 )
332 332
         elif attrs['ethertype'] == 'IPv4':
@@ -370,7 +370,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
370 370
             if parsed_args.src_group:
371 371
                 LOG.warning(
372 372
                     _("The %(old)s option is deprecated, "
373
-                      "please use %(new)s instead.") %
373
+                      "please use %(new)s instead."),
374 374
                     {'old': '--src-group', 'new': '--remote-group'},
375 375
                 )
376 376
         if not (parsed_args.remote_ip is None and
@@ -379,7 +379,7 @@ class CreateSecurityGroupRule(common.NetworkAndComputeShowOne):
379 379
             if parsed_args.src_ip:
380 380
                 LOG.warning(
381 381
                     _("The %(old)s option is deprecated, "
382
-                      "please use %(new)s instead.") %
382
+                      "please use %(new)s instead."),
383 383
                     {'old': '--src-ip', 'new': '--remote-ip'},
384 384
                 )
385 385
         else:

+ 2
- 2
openstackclient/network/v2/subnet.py View File

@@ -365,8 +365,8 @@ class DeleteSubnet(command.Command):
365 365
             except Exception as e:
366 366
                 result += 1
367 367
                 LOG.error(_("Failed to delete subnet with "
368
-                          "name or ID '%(subnet)s': %(e)s")
369
-                          % {'subnet': subnet, 'e': e})
368
+                          "name or ID '%(subnet)s': %(e)s"),
369
+                          {'subnet': subnet, 'e': e})
370 370
 
371 371
         if result > 0:
372 372
             total = len(parsed_args.subnet)

+ 2
- 2
openstackclient/network/v2/subnet_pool.py View File

@@ -220,8 +220,8 @@ class DeleteSubnetPool(command.Command):
220 220
             except Exception as e:
221 221
                 result += 1
222 222
                 LOG.error(_("Failed to delete subnet pool with "
223
-                          "name or ID '%(pool)s': %(e)s")
224
-                          % {'pool': pool, 'e': e})
223
+                          "name or ID '%(pool)s': %(e)s"),
224
+                          {'pool': pool, 'e': e})
225 225
 
226 226
         if result > 0:
227 227
             total = len(parsed_args.subnet_pool)

Loading…
Cancel
Save