Browse Source

Handle log message interpolation by the logger in identity/

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

Change-Id: I1d6588093616099a9eef0947c09e038b9e53493a
Related-Bug: #1596829
tags/3.9.0
Gábor Antal 2 years ago
parent
commit
335c8d3ef3

+ 2
- 2
openstackclient/identity/v2_0/ec2creds.py View File

@@ -122,8 +122,8 @@ class DeleteEC2Creds(command.Command):
122 122
             except Exception as e:
123 123
                 result += 1
124 124
                 LOG.error(_("Failed to delete EC2 credentials with "
125
-                          "access key '%(access_key)s': %(e)s")
126
-                          % {'access_key': access_key, 'e': e})
125
+                          "access key '%(access_key)s': %(e)s"),
126
+                          {'access_key': access_key, 'e': e})
127 127
 
128 128
         if result > 0:
129 129
             total = len(parsed_args.access_keys)

+ 2
- 2
openstackclient/identity/v2_0/endpoint.py View File

@@ -102,8 +102,8 @@ class DeleteEndpoint(command.Command):
102 102
             except Exception as e:
103 103
                 result += 1
104 104
                 LOG.error(_("Failed to delete endpoint with "
105
-                          "ID '%(endpoint)s': %(e)s")
106
-                          % {'endpoint': endpoint, 'e': e})
105
+                          "ID '%(endpoint)s': %(e)s"),
106
+                          {'endpoint': endpoint, 'e': e})
107 107
 
108 108
         if result > 0:
109 109
             total = len(parsed_args.endpoints)

+ 2
- 2
openstackclient/identity/v2_0/service.py View File

@@ -114,8 +114,8 @@ class DeleteService(command.Command):
114 114
             except Exception as e:
115 115
                 result += 1
116 116
                 LOG.error(_("Failed to delete service with "
117
-                          "name or ID '%(service)s': %(e)s")
118
-                          % {'service': service, 'e': e})
117
+                          "name or ID '%(service)s': %(e)s"),
118
+                          {'service': service, 'e': e})
119 119
 
120 120
         if result > 0:
121 121
             total = len(parsed_args.services)

+ 1
- 2
openstackclient/identity/v3/consumer.py View File

@@ -73,8 +73,7 @@ class DeleteConsumer(command.Command):
73 73
             except Exception as e:
74 74
                 result += 1
75 75
                 LOG.error(_("Failed to delete consumer with name or "
76
-                          "ID '%(consumer)s': %(e)s")
77
-                          % {'consumer': i, 'e': e})
76
+                          "ID '%(consumer)s': %(e)s"), {'consumer': i, 'e': e})
78 77
 
79 78
         if result > 0:
80 79
             total = len(parsed_args.consumer)

+ 2
- 2
openstackclient/identity/v3/credential.py View File

@@ -99,8 +99,8 @@ class DeleteCredential(command.Command):
99 99
             except Exception as e:
100 100
                 result += 1
101 101
                 LOG.error(_("Failed to delete credentials with "
102
-                          "ID '%(credential)s': %(e)s")
103
-                          % {'credential': i, 'e': e})
102
+                          "ID '%(credential)s': %(e)s"),
103
+                          {'credential': i, 'e': e})
104 104
 
105 105
         if result > 0:
106 106
             total = len(parsed_args.credential)

+ 1
- 2
openstackclient/identity/v3/domain.py View File

@@ -111,8 +111,7 @@ class DeleteDomain(command.Command):
111 111
             except Exception as e:
112 112
                 result += 1
113 113
                 LOG.error(_("Failed to delete domain with name or "
114
-                          "ID '%(domain)s': %(e)s")
115
-                          % {'domain': i, 'e': e})
114
+                          "ID '%(domain)s': %(e)s"), {'domain': i, 'e': e})
116 115
 
117 116
         if result > 0:
118 117
             total = len(parsed_args.domain)

+ 2
- 2
openstackclient/identity/v3/ec2creds.py View File

@@ -140,8 +140,8 @@ class DeleteEC2Creds(command.Command):
140 140
             except Exception as e:
141 141
                 result += 1
142 142
                 LOG.error(_("Failed to delete EC2 credentials with "
143
-                          "access key '%(access_key)s': %(e)s")
144
-                          % {'access_key': i, 'e': e})
143
+                          "access key '%(access_key)s': %(e)s"),
144
+                          {'access_key': i, 'e': e})
145 145
 
146 146
         if result > 0:
147 147
             total = len(parsed_args.access_key)

+ 1
- 2
openstackclient/identity/v3/endpoint.py View File

@@ -122,8 +122,7 @@ class DeleteEndpoint(command.Command):
122 122
             except Exception as e:
123 123
                 result += 1
124 124
                 LOG.error(_("Failed to delete endpoint with "
125
-                          "ID '%(endpoint)s': %(e)s")
126
-                          % {'endpoint': i, 'e': e})
125
+                          "ID '%(endpoint)s': %(e)s"), {'endpoint': i, 'e': e})
127 126
 
128 127
         if result > 0:
129 128
             total = len(parsed_args.endpoint)

+ 2
- 2
openstackclient/identity/v3/federation_protocol.py View File

@@ -102,8 +102,8 @@ class DeleteProtocol(command.Command):
102 102
             except Exception as e:
103 103
                 result += 1
104 104
                 LOG.error(_("Failed to delete federation protocol "
105
-                          "with name or ID '%(protocol)s': %(e)s")
106
-                          % {'protocol': i, 'e': e})
105
+                          "with name or ID '%(protocol)s': %(e)s"),
106
+                          {'protocol': i, 'e': e})
107 107
 
108 108
         if result > 0:
109 109
             total = len(parsed_args.federation_protocol)

+ 2
- 2
openstackclient/identity/v3/identity_provider.py View File

@@ -115,8 +115,8 @@ class DeleteIdentityProvider(command.Command):
115 115
             except Exception as e:
116 116
                 result += 1
117 117
                 LOG.error(_("Failed to delete identity providers with "
118
-                          "name or ID '%(provider)s': %(e)s")
119
-                          % {'provider': i, 'e': e})
118
+                          "name or ID '%(provider)s': %(e)s"),
119
+                          {'provider': i, 'e': e})
120 120
 
121 121
         if result > 0:
122 122
             total = len(parsed_args.identity_provider)

+ 1
- 2
openstackclient/identity/v3/mapping.py View File

@@ -132,8 +132,7 @@ class DeleteMapping(command.Command):
132 132
             except Exception as e:
133 133
                 result += 1
134 134
                 LOG.error(_("Failed to delete mapping with name or "
135
-                          "ID '%(mapping)s': %(e)s")
136
-                          % {'mapping': i, 'e': e})
135
+                          "ID '%(mapping)s': %(e)s"), {'mapping': i, 'e': e})
137 136
 
138 137
         if result > 0:
139 138
             total = len(parsed_args.mapping)

+ 1
- 2
openstackclient/identity/v3/policy.py View File

@@ -82,8 +82,7 @@ class DeletePolicy(command.Command):
82 82
             except Exception as e:
83 83
                 result += 1
84 84
                 LOG.error(_("Failed to delete policy with name or "
85
-                          "ID '%(policy)s': %(e)s")
86
-                          % {'policy': i, 'e': e})
85
+                          "ID '%(policy)s': %(e)s"), {'policy': i, 'e': e})
87 86
 
88 87
         if result > 0:
89 88
             total = len(parsed_args.policy)

+ 1
- 2
openstackclient/identity/v3/region.py View File

@@ -87,8 +87,7 @@ class DeleteRegion(command.Command):
87 87
             except Exception as e:
88 88
                 result += 1
89 89
                 LOG.error(_("Failed to delete region with "
90
-                          "ID '%(region)s': %(e)s")
91
-                          % {'region': i, 'e': e})
90
+                          "ID '%(region)s': %(e)s"), {'region': i, 'e': e})
92 91
 
93 92
         if result > 0:
94 93
             total = len(parsed_args.region)

+ 2
- 2
openstackclient/identity/v3/service.py View File

@@ -103,8 +103,8 @@ class DeleteService(command.Command):
103 103
             except Exception as e:
104 104
                 result += 1
105 105
                 LOG.error(_("Failed to delete consumer with type, "
106
-                          "name or ID '%(service)s': %(e)s")
107
-                          % {'service': i, 'e': e})
106
+                          "name or ID '%(service)s': %(e)s"),
107
+                          {'service': i, 'e': e})
108 108
 
109 109
         if result > 0:
110 110
             total = len(parsed_args.service)

+ 2
- 2
openstackclient/identity/v3/service_provider.py View File

@@ -108,8 +108,8 @@ class DeleteServiceProvider(command.Command):
108 108
             except Exception as e:
109 109
                 result += 1
110 110
                 LOG.error(_("Failed to delete service provider with "
111
-                          "name or ID '%(provider)s': %(e)s")
112
-                          % {'provider': i, 'e': e})
111
+                          "name or ID '%(provider)s': %(e)s"),
112
+                          {'provider': i, 'e': e})
113 113
 
114 114
         if result > 0:
115 115
             total = len(parsed_args.service_provider)

Loading…
Cancel
Save