Browse Source

Fix string interpolation at logging call

Skip creating the formatted log message
if the message is not going to be emitted
because of the log level.

See the oslo i18n guideline.

* http://docs.openstack.org/developer/oslo.i18n/guidelines.html#\
  adding-variables-to-log-messages

Change-Id: Ie9f3c9179cdae57ee298149f829811a5422fb9aa
Closes-Bug: #1596829
tags/4.0.0.0b3
Takashi NATSUME 3 years ago
parent
commit
fb921a86d3

+ 7
- 7
congress/api/row_model.py View File

@@ -122,7 +122,7 @@ class RowModel(base.APIModel):
122 122
             KeyError: table id doesn't exist
123 123
             DataModelException: any error occurs during replacing rows.
124 124
         """
125
-        LOG.info("update_items(context=%s)" % context)
125
+        LOG.info("update_items(context=%s)", context)
126 126
         # Note(thread-safety): blocking call
127 127
         caller, source_id = api_utils.get_id_from_context(context,
128 128
                                                           self.datasource_mgr,
@@ -141,13 +141,13 @@ class RowModel(base.APIModel):
141 141
             # Note(thread-safety): blocking call
142 142
             self.invoke_rpc(caller, 'update_entire_data', args)
143 143
         except exception.CongressException as e:
144
-            m = ("Error occurred while processing updating rows for "
145
-                 "source_id '%s' and table_id '%s'" % (source_id, table_id))
146
-            LOG.exception(m)
144
+            LOG.exception("Error occurred while processing updating rows "
145
+                          "for source_id '%s' and table_id '%s'",
146
+                          source_id, table_id)
147 147
             raise webservice.DataModelException.create(e)
148
-        LOG.info("finish update_items(context=%s)" % context)
149
-        LOG.debug("updated table %s with row items: %s" %
150
-                  (table_id, str(items)))
148
+        LOG.info("finish update_items(context=%s)", context)
149
+        LOG.debug("updated table %s with row items: %s",
150
+                  table_id, str(items))
151 151
 
152 152
     # TODO(thinrichs): It makes sense to sometimes allow users to create
153 153
     #  a new row for internal data sources.  But since we don't have

+ 1
- 1
congress/common/eventlet_server.py View File

@@ -125,7 +125,7 @@ class APIServer(service.ServiceBase):
125 125
             self.application = deploy.loadapp('config:%s' % self.app_conf,
126 126
                                               name='congress', **kwargs)
127 127
         except Exception:
128
-            LOG.exception('Failed to Start %s server' % self.node.node_id)
128
+            LOG.exception('Failed to Start %s server', self.node.node_id)
129 129
             raise exception.CongressException(
130 130
                 'Failed to Start initializing %s server' % self.node.node_id)
131 131
 

+ 1
- 1
congress/datalog/compile.py View File

@@ -139,7 +139,7 @@ class Schema(object):
139 139
                 schema_change = (tablename, val, True, th)
140 140
         else:
141 141
             if tablename not in self:
142
-                LOG.warning("Attempt to delete a non-existant rule: %s" % item)
142
+                LOG.warning("Attempt to delete a non-existant rule: %s", item)
143 143
             elif self.count[tablename] > 1:
144 144
                 self.count[tablename] -= 1
145 145
                 schema_change = (tablename, None, False, th)

+ 12
- 12
congress/datasources/ceilometer_driver.py View File

@@ -184,7 +184,7 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
184 184
         LOG.debug("Ceilometer grabbing meters")
185 185
         meters = self.ceilometer_client.meters.list()
186 186
         self._translate_meters(meters)
187
-        LOG.debug("METERS: %s" % str(self.state[self.METERS]))
187
+        LOG.debug("METERS: %s", str(self.state[self.METERS]))
188 188
 
189 189
         # TODO(ramineni): Ceilometer alarms is moved to separate
190 190
         # project Aodh. It's not fully functional yet.
@@ -200,26 +200,26 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
200 200
         LOG.debug("Ceilometer grabbing events")
201 201
         events = self.ceilometer_client.events.list()
202 202
         self._translate_events(events)
203
-        LOG.debug("EVENTS: %s" % str(self.state[self.EVENTS]))
204
-        LOG.debug("TRAITS: %s" % str(self.state[self.EVENT_TRAITS]))
203
+        LOG.debug("EVENTS: %s", str(self.state[self.EVENTS]))
204
+        LOG.debug("TRAITS: %s", str(self.state[self.EVENT_TRAITS]))
205 205
 
206 206
         LOG.debug("Ceilometer grabbing statistics")
207 207
         statistics = self._get_statistics(meters)
208 208
         self._translate_statistics(statistics)
209
-        LOG.debug("STATISTICS: %s" % str(self.state[self.STATISTICS]))
209
+        LOG.debug("STATISTICS: %s", str(self.state[self.STATISTICS]))
210 210
 
211 211
     def _get_statistics(self, meters):
212 212
         statistics = []
213 213
         names = set()
214 214
         for m in meters:
215
-            LOG.debug("Adding meter %s" % m.name)
215
+            LOG.debug("Adding meter %s", m.name)
216 216
             names.add(m.name)
217 217
         for meter_name in names:
218
-            LOG.debug("Getting all Resource ID for meter: %s"
219
-                      % meter_name)
218
+            LOG.debug("Getting all Resource ID for meter: %s",
219
+                      meter_name)
220 220
             stat_list = self.ceilometer_client.statistics.list(
221 221
                 meter_name, groupby=['resource_id'])
222
-            LOG.debug("Statistics List: %s" % stat_list)
222
+            LOG.debug("Statistics List: %s", stat_list)
223 223
             if (stat_list):
224 224
                 for temp in stat_list:
225 225
                     temp_dict = copy.copy(temp.to_dict())
@@ -232,7 +232,7 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
232 232
         """Translate the meters represented by OBJ into tables."""
233 233
         meters = [o.to_dict() for o in obj]
234 234
 
235
-        LOG.debug("METERS: %s" % str(meters))
235
+        LOG.debug("METERS: %s", str(meters))
236 236
 
237 237
         row_data = CeilometerDriver.convert_objs(meters,
238 238
                                                  self.meters_translator)
@@ -242,7 +242,7 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
242 242
     def _translate_alarms(self, obj):
243 243
         """Translate the alarms represented by OBJ into tables."""
244 244
         alarms = [o.to_dict() for o in obj]
245
-        LOG.debug("ALARMS: %s" % str(alarms))
245
+        LOG.debug("ALARMS: %s", str(alarms))
246 246
 
247 247
         row_data = CeilometerDriver.convert_objs(alarms,
248 248
                                                  self.alarms_translator)
@@ -252,7 +252,7 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
252 252
     def _translate_events(self, obj):
253 253
         """Translate the events represented by OBJ into tables."""
254 254
         events = [o.to_dict() for o in obj]
255
-        LOG.debug("EVENTS: %s" % str(events))
255
+        LOG.debug("EVENTS: %s", str(events))
256 256
 
257 257
         row_data = CeilometerDriver.convert_objs(events,
258 258
                                                  self.events_translator)
@@ -261,7 +261,7 @@ class CeilometerDriver(datasource_driver.PollingDataSourceDriver,
261 261
     @ds_utils.update_state_on_changed(STATISTICS)
262 262
     def _translate_statistics(self, obj):
263 263
         """Translate the statistics represented by OBJ into tables."""
264
-        LOG.debug("STATISTICS: %s" % str(obj))
264
+        LOG.debug("STATISTICS: %s", str(obj))
265 265
 
266 266
         row_data = CeilometerDriver.convert_objs(obj,
267 267
                                                  self.statistics_translator)

+ 7
- 7
congress/datasources/datasource_driver.py View File

@@ -336,8 +336,8 @@ class DataSourceDriver(deepsix.deepSix):
336 336
             self.add_rpc_endpoint(DataSourceDriverEndpoints(self))
337 337
 
338 338
     def get_snapshot(self, table_name):
339
-        LOG.debug("datasource_driver get_snapshot(%s); %s" % (
340
-            table_name, self.state))
339
+        LOG.debug("datasource_driver get_snapshot(%s); %s",
340
+                  table_name, self.state)
341 341
         return self.state.get(table_name, set())
342 342
 
343 343
     def _make_tmp_state(self, root_table_name, row_data):
@@ -1208,14 +1208,14 @@ class PushedDataSourceDriver(DataSourceDriver):
1208 1208
 
1209 1209
     # Note (thread-safety): blocking function
1210 1210
     def update_entire_data(self, table_id, objs):
1211
-        LOG.info('update %s table in %s datasource' % (table_id, self.name))
1211
+        LOG.info('update %s table in %s datasource', table_id, self.name)
1212 1212
         translator = self.get_translator(table_id)
1213 1213
         tablename = translator['table-name']
1214 1214
         self.prior_state = dict(self.state)
1215 1215
         self._update_state(
1216 1216
             tablename, PushedDataSourceDriver.convert_objs(objs, translator))
1217
-        LOG.debug('publish a new state %s in %s' %
1218
-                  (self.state[tablename], tablename))
1217
+        LOG.debug('publish a new state %s in %s',
1218
+                  self.state[tablename], tablename)
1219 1219
         # Note (thread-safety): blocking call
1220 1220
         self.publish(tablename, self.state[tablename])
1221 1221
         self.number_of_updates += 1
@@ -1464,8 +1464,8 @@ class ExecutionDriver(object):
1464 1464
         positional_args = action_args.get('positional', [])
1465 1465
         named_args = action_args.get('named', {})
1466 1466
         LOG.debug('Processing action execution: action = %s, '
1467
-                  'positional args = %s, named args = %s'
1468
-                  % (action, positional_args, named_args))
1467
+                  'positional args = %s, named args = %s',
1468
+                  action, positional_args, named_args)
1469 1469
         try:
1470 1470
             method = self._get_method(client, action)
1471 1471
             # Note(thread-safety): blocking call (potentially)

+ 4
- 4
congress/datasources/monasca_driver.py View File

@@ -131,7 +131,7 @@ class MonascaDriver(datasource_driver.PollingDataSourceDriver,
131 131
             LOG.debug("Monasca grabbing metrics")
132 132
             metrics = self.monasca.metrics.list()
133 133
             self._translate_metric(metrics)
134
-            LOG.debug("METRICS: %s" % str(self.state[self.METRICS]))
134
+            LOG.debug("METRICS: %s", str(self.state[self.METRICS]))
135 135
 
136 136
             LOG.debug("Monasca grabbing statistics")
137 137
             # gather statistic for the last day
@@ -150,7 +150,7 @@ class MonascaDriver(datasource_driver.PollingDataSourceDriver,
150 150
                 statistics = self.monasca.metrics.list_statistics(
151 151
                     **_query_args)
152 152
                 self._translate_statistics(statistics)
153
-                LOG.debug("STATISTICS: %s" % str(self.state[self.STATISTICS]))
153
+                LOG.debug("STATISTICS: %s", str(self.state[self.STATISTICS]))
154 154
 
155 155
         except Exception as e:
156 156
             raise e
@@ -158,7 +158,7 @@ class MonascaDriver(datasource_driver.PollingDataSourceDriver,
158 158
     @ds_utils.update_state_on_changed(METRICS)
159 159
     def _translate_metric(self, obj):
160 160
         """Translate the metrics represented by OBJ into tables."""
161
-        LOG.debug("METRIC: %s" % str(obj))
161
+        LOG.debug("METRIC: %s", str(obj))
162 162
 
163 163
         row_data = MonascaDriver.convert_objs(obj,
164 164
                                               self.metric_translator)
@@ -168,7 +168,7 @@ class MonascaDriver(datasource_driver.PollingDataSourceDriver,
168 168
     def _translate_statistics(self, obj):
169 169
         """Translate the metrics represented by OBJ into tables."""
170 170
 
171
-        LOG.debug("STATISTICS: %s" % str(obj))
171
+        LOG.debug("STATISTICS: %s", str(obj))
172 172
 
173 173
         row_data = MonascaDriver.convert_objs(obj,
174 174
                                               self.statistics_translator)

+ 3
- 3
congress/datasources/push_driver.py View File

@@ -71,13 +71,13 @@ class PushDriver(datasource_driver.PushedDataSourceDriver):
71 71
         return result
72 72
 
73 73
     def update_entire_data(self, table_id, objs):
74
-        LOG.info('update %s table in %s datasource' % (table_id, self.name))
74
+        LOG.info('update %s table in %s datasource', table_id, self.name)
75 75
         tablename = 'data'  # hard code
76 76
         self.prior_state = dict(self.state)
77 77
         self._update_state(tablename,
78 78
                            [tuple([table_id, tuple(x)]) for x in objs])
79
-        LOG.debug('publish a new state %s in %s' %
80
-                  (self.state[tablename], tablename))
79
+        LOG.debug('publish a new state %s in %s',
80
+                  self.state[tablename], tablename)
81 81
         self.publish(tablename, self.state[tablename])
82 82
         self.number_of_updates += 1
83 83
         self.last_updated_time = datetime.datetime.now()

+ 4
- 4
congress/datasources/swift_driver.py View File

@@ -106,12 +106,12 @@ class SwiftDriver(datasource_driver.PollingDataSourceDriver,
106 106
         '''
107 107
         containers, objects = self._get_containers_and_objects()
108 108
 
109
-        LOG.debug("Containers Lists--->: %s" % containers)
110
-        LOG.debug("Object Lists--->: %s " % objects)
109
+        LOG.debug("Containers Lists--->: %s", containers)
110
+        LOG.debug("Object Lists--->: %s ", objects)
111 111
         self._translate_containers(containers)
112 112
         self._translate_objects(objects)
113
-        LOG.debug("CONTAINERS: %s" % str(self.state[self.CONTAINERS]))
114
-        LOG.debug("OBJECTS: %s" % str(self.state[self.OBJECTS]))
113
+        LOG.debug("CONTAINERS: %s", str(self.state[self.CONTAINERS]))
114
+        LOG.debug("OBJECTS: %s", str(self.state[self.OBJECTS]))
115 115
 
116 116
     def _get_containers_and_objects(self):
117 117
         container_list = self.swift_service.list()

+ 2
- 2
congress/dse2/dse_node.py View File

@@ -222,7 +222,7 @@ class DseNode(object):
222 222
         if self._running is False:
223 223
             return
224 224
 
225
-        LOG.info("Stopping DSE node '%s'" % self.node_id)
225
+        LOG.info("Stopping DSE node '%s'", self.node_id)
226 226
         for s in self._services:
227 227
             s.stop()
228 228
         self._rpc_server.stop()
@@ -751,7 +751,7 @@ class DseNode(object):
751 751
             service = getattr(module, class_name)(**kwargs)
752 752
         except Exception:
753 753
             msg = ("Error loading instance of module '%s'")
754
-            LOG.exception(msg % class_path)
754
+            LOG.exception(msg, class_path)
755 755
             raise exception.DataServiceError(msg % class_path)
756 756
         return service
757 757
 

+ 2
- 2
congress/harness.py View File

@@ -371,7 +371,7 @@ def create_datasources(bus):
371 371
     datasources = db_datasources.get_datasources()
372 372
     services = []
373 373
     for ds in datasources:
374
-        LOG.info("create configured datasource service %s." % ds.name)
374
+        LOG.info("create configured datasource service %s.", ds.name)
375 375
         try:
376 376
             service = bus.create_datasource_service(ds)
377 377
             if service:
@@ -384,7 +384,7 @@ def create_datasources(bus):
384 384
                           "clean up stale datasources in DB.")
385 385
             sys.exit(1)
386 386
         except Exception:
387
-            LOG.exception("datasource %s creation failed." % ds.name)
387
+            LOG.exception("datasource %s creation failed.", ds.name)
388 388
             raise
389 389
 
390 390
     return services

+ 1
- 1
congress/utils.py View File

@@ -97,7 +97,7 @@ def removed_in_dse2(wrapped):
97 97
     @functools.wraps(wrapped)
98 98
     def wrapper(*args, **kwargs):
99 99
         if cfg.CONF.distributed_architecture:
100
-            LOG.error('%s is called in dse2' % wrapped.__name__)
100
+            LOG.error('%s is called in dse2', wrapped.__name__)
101 101
             raise Exception('inappropriate function is called.')
102 102
         else:
103 103
             return wrapped(*args, **kwargs)

+ 1
- 1
congress_dashboard/api/congress.py View File

@@ -285,7 +285,7 @@ def datasource_statuses_list(request):
285 285
         try:
286 286
             status = client.list_datasource_status(ds['id'])
287 287
         except Exception as e:
288
-            LOG.info("Exception while getting the status: %s" % e)
288
+            LOG.info("Exception while getting the status: %s", e)
289 289
             status = "not available"
290 290
             raise e
291 291
         wrapper = PolicyAPIDictWrapper(ds)

+ 11
- 11
congress_dashboard/datasources/utils.py View File

@@ -27,7 +27,7 @@ def _get_policy_tables(request):
27 27
         # Get all the policies.
28 28
         policies = congress.policies_list(request)
29 29
     except Exception as e:
30
-        LOG.error('Unable to get list of policies: %s' % e.message)
30
+        LOG.error('Unable to get list of policies: %s', e.message)
31 31
     else:
32 32
         try:
33 33
             for policy in policies:
@@ -47,8 +47,8 @@ def _get_policy_tables(request):
47 47
                 all_tables.append({'datasource': policy_name,
48 48
                                    'tables': datasource_tables})
49 49
         except Exception as e:
50
-            LOG.error('Unable to get tables for policy "%s": %s' %
51
-                      (policy_name, e.message))
50
+            LOG.error('Unable to get tables for policy "%s": %s',
51
+                      policy_name, e.message)
52 52
     return all_tables
53 53
 
54 54
 
@@ -59,7 +59,7 @@ def _get_service_tables(request):
59 59
         # Get all the services.
60 60
         services = congress.datasources_list(request)
61 61
     except Exception as e:
62
-        LOG.error('Unable to get list of data sources: %s' % e.message)
62
+        LOG.error('Unable to get list of data sources: %s', e.message)
63 63
     else:
64 64
         try:
65 65
             for service in services:
@@ -76,8 +76,8 @@ def _get_service_tables(request):
76 76
                 all_tables.append({'datasource': service['name'],
77 77
                                    'tables': datasource_tables})
78 78
         except Exception as e:
79
-            LOG.error('Unable to get tables for data source "%s": %s' %
80
-                      (service_id, e.message))
79
+            LOG.error('Unable to get tables for data source "%s": %s',
80
+                      service_id, e.message)
81 81
     return all_tables
82 82
 
83 83
 
@@ -154,14 +154,14 @@ def get_datasource_columns(request):
154 154
             all_columns.append({'datasource': policy_name,
155 155
                                 'tables': datasource_tables})
156 156
     except Exception as e:
157
-        LOG.error('Unable to get schema for policy "%s" table "%s": %s' %
158
-                  (policy_name, table_name, e.message))
157
+        LOG.error('Unable to get schema for policy "%s" table "%s": %s',
158
+                  policy_name, table_name, e.message)
159 159
 
160 160
     try:
161 161
         # Get all the services.
162 162
         services = congress.datasources_list(request)
163 163
     except Exception as e:
164
-        LOG.error('Unable to get list of data sources: %s' % e.message)
164
+        LOG.error('Unable to get list of data sources: %s', e.message)
165 165
     else:
166 166
         try:
167 167
             for service in services:
@@ -181,7 +181,7 @@ def get_datasource_columns(request):
181 181
                 all_columns.append({'datasource': service_name,
182 182
                                     'tables': datasource_tables})
183 183
         except Exception as e:
184
-            LOG.error('Unable to get schema for data source "%s": %s' %
185
-                      (service_id, e.message))
184
+            LOG.error('Unable to get schema for data source "%s": %s',
185
+                      service_id, e.message)
186 186
 
187 187
     return all_columns

+ 3
- 3
congress_dashboard/policies/forms.py View File

@@ -45,9 +45,9 @@ class CreatePolicy(forms.SelfHandlingForm):
45 45
         policy_name = data['name']
46 46
         policy_description = data.get('description')
47 47
         policy_kind = data.pop('kind')
48
-        LOG.info('User %s creating policy "%s" of type %s in tenant %s' %
49
-                 (request.user.username, policy_name, policy_kind,
50
-                  request.user.tenant_name))
48
+        LOG.info('User %s creating policy "%s" of type %s in tenant %s',
49
+                 request.user.username, policy_name, policy_kind,
50
+                 request.user.tenant_name)
51 51
         try:
52 52
             params = {
53 53
                 'name': policy_name,

+ 4
- 4
congress_dashboard/policies/rules/tables.py View File

@@ -63,12 +63,12 @@ class DeleteRule(policy.PolicyTargetMixin, tables.DeleteAction):
63 63
 
64 64
     def delete(self, request, obj_id):
65 65
         policy_name = self.table.kwargs['policy_name']
66
-        LOG.info('User %s deleting policy "%s" rule "%s" in tenant %s' %
67
-                 (request.user.username, policy_name, obj_id,
68
-                  request.user.tenant_name))
66
+        LOG.info('User %s deleting policy "%s" rule "%s" in tenant %s',
67
+                 request.user.username, policy_name, obj_id,
68
+                 request.user.tenant_name)
69 69
         try:
70 70
             congress.policy_rule_delete(request, policy_name, obj_id)
71
-            LOG.info('Deleted policy rule "%s"' % obj_id)
71
+            LOG.info('Deleted policy rule "%s"', obj_id)
72 72
         except Exception as e:
73 73
             msg_args = {'rule_id': obj_id, 'error': e.message}
74 74
             msg = _('Failed to delete policy rule "%(rule_id)s": '

+ 8
- 8
congress_dashboard/policies/rules/workflows.py View File

@@ -220,8 +220,8 @@ class CreateRule(workflows.Workflow):
220 220
             except Exception as e:
221 221
                 # Nope.
222 222
                 LOG.error('Unable to get schema for table "%s", '
223
-                          'datasource "%s": %s' % (table_name, datasource,
224
-                                                   e.message))
223
+                          'datasource "%s": %s',
224
+                          table_name, datasource, e.message)
225 225
                 return e.message
226 226
         return schema['columns']
227 227
 
@@ -364,7 +364,7 @@ class CreateRule(workflows.Workflow):
364 364
                     column_variables[value] = variable
365 365
                     column_variables[negation_column] = variable
366 366
 
367
-        LOG.debug('column_variables for rule: %s' % column_variables)
367
+        LOG.debug('column_variables for rule: %s', column_variables)
368 368
 
369 369
         # Form the literals for all the tables needed in the body. Make sure
370 370
         # column that have no relation to any other columns are given a unique
@@ -421,8 +421,8 @@ class CreateRule(workflows.Workflow):
421 421
         # All together now.
422 422
         rule = '%s(%s) %s %s' % (policy_table, ', '.join(head_columns),
423 423
                                  congress.RULE_SEPARATOR, ', '.join(literals))
424
-        LOG.info('User %s creating policy "%s" rule "%s" in tenant %s: %s' %
425
-                 (username, policy_name, rule_name, project_name, rule))
424
+        LOG.info('User %s creating policy "%s" rule "%s" in tenant %s: %s',
425
+                 username, policy_name, rule_name, project_name, rule)
426 426
         try:
427 427
             params = {
428 428
                 'name': rule_name,
@@ -431,11 +431,11 @@ class CreateRule(workflows.Workflow):
431 431
             }
432 432
             rule = congress.policy_rule_create(request, policy_name,
433 433
                                                body=params)
434
-            LOG.info('Created rule %s' % rule['id'])
434
+            LOG.info('Created rule %s', rule['id'])
435 435
             self.context['rule_id'] = rule['id']
436 436
         except Exception as e:
437
-            LOG.error('Error creating policy "%s" rule "%s": %s' %
438
-                      (policy_name, rule_name, e.message))
437
+            LOG.error('Error creating policy "%s" rule "%s": %s',
438
+                      policy_name, rule_name, e.message)
439 439
             self.context['error'] = e.message
440 440
             return False
441 441
         return True

+ 3
- 3
congress_dashboard/policies/tables.py View File

@@ -60,11 +60,11 @@ class DeletePolicy(policy.PolicyTargetMixin, tables.DeleteAction):
60 60
     redirect_url = 'horizon:admin:policies:index'
61 61
 
62 62
     def delete(self, request, obj_id):
63
-        LOG.info('User %s deleting policy "%s" in tenant %s' %
64
-                 (request.user.username, obj_id, request.user.tenant_name))
63
+        LOG.info('User %s deleting policy "%s" in tenant %s',
64
+                 request.user.username, obj_id, request.user.tenant_name)
65 65
         try:
66 66
             congress.policy_delete(request, obj_id)
67
-            LOG.info('Deleted policy "%s"' % obj_id)
67
+            LOG.info('Deleted policy "%s"', obj_id)
68 68
         except Exception as e:
69 69
             msg_args = {'policy_id': obj_id, 'error': e.message}
70 70
             msg = _('Failed to delete policy "%(policy_id)s": '

+ 1
- 1
congress_tempest_tests/tests/scenario/congress_ha/test_ha.py View File

@@ -81,7 +81,7 @@ class TestHA(manager_congress.ScenarioPolicyBase):
81 81
                 conf[index:])
82 82
         sindex = conf.find('signing_dir')
83 83
         conf = conf[:sindex] + '#' + conf[sindex:]
84
-        LOG.debug("Configuration file for replica: %s\n" % conf)
84
+        LOG.debug("Configuration file for replica: %s\n", conf)
85 85
         f.write(conf)
86 86
         f.close()
87 87
 

Loading…
Cancel
Save