Browse Source

Replace deprecated LOG.warn with LOG.warning

LOG.warn is deprecated. It is still used in few modules.
Replaced with non-deprecated LOG.warning.

Change-Id: I0496a3618bbe2f53c06d96e1df725763cd39b032
Partial-Bug: #1508442
tags/2.0.0.0b3
yatin karel 3 years ago
parent
commit
f11fe2e82f
2 changed files with 13 additions and 11 deletions
  1. 7
    5
      senlin/engine/health_manager.py
  2. 6
    6
      senlin/profiles/base.py

+ 7
- 5
senlin/engine/health_manager.py View File

@@ -52,8 +52,8 @@ class NotificationEndpoint(object):
52 52
     def warn(self, ctxt, publisher_id, event_type, payload, metadata):
53 53
         metadata = payload['metadata']
54 54
         if 'cluster' in metadata and metadata['cluster'] == self.cluster_id:
55
-            LOG.warn("publisher=%s" % publisher_id)
56
-            LOG.warn("event_type=%s" % event_type)
55
+            LOG.warning("publisher=%s" % publisher_id)
56
+            LOG.warning("event_type=%s" % event_type)
57 57
 
58 58
     def debug(self, ctxt, publisher_id, event_type, payload, metadata):
59 59
         metadata = payload['metadata']
@@ -117,7 +117,7 @@ class HealthManager(service.Service):
117 117
         """
118 118
         cluster = objects.Cluster.get(self.ctx, cluster_id)
119 119
         if not cluster:
120
-            LOG.warn(_LW("Cluster (%s) is not found."), cluster_id)
120
+            LOG.warning(_LW("Cluster (%s) is not found."), cluster_id)
121 121
             return
122 122
 
123 123
         project = cluster.project
@@ -143,8 +143,10 @@ class HealthManager(service.Service):
143 143
             else:
144 144
                 return None
145 145
         else:
146
-            LOG.warn(_LW("Cluster (%(id)s) check type (%(type)s) is invalid."),
147
-                     {'id': entry['cluster_id'], 'type': entry['check_type']})
146
+            LOG.warning(_LW("Cluster (%(id)s) check type (%(type)s) is "
147
+                            "invalid."),
148
+                        {'id': entry['cluster_id'],
149
+                         'type': entry['check_type']})
148 150
             return None
149 151
 
150 152
         return entry

+ 6
- 6
senlin/profiles/base.py View File

@@ -286,32 +286,32 @@ class Profile(object):
286 286
 
287 287
     def do_update(self, obj, new_profile, **params):
288 288
         """For subclass to override."""
289
-        LOG.warn(_LW("Update operation not supported."))
289
+        LOG.warning(_LW("Update operation not supported."))
290 290
         return True
291 291
 
292 292
     def do_check(self, obj):
293 293
         """For subclass to override."""
294
-        LOG.warn(_LW("Check operation not supported."))
294
+        LOG.warning(_LW("Check operation not supported."))
295 295
         return True
296 296
 
297 297
     def do_get_details(self, obj):
298 298
         """For subclass to override."""
299
-        LOG.warn(_LW("Get_details operation not supported."))
299
+        LOG.warning(_LW("Get_details operation not supported."))
300 300
         return {}
301 301
 
302 302
     def do_join(self, obj, cluster_id):
303 303
         """For subclass to override to perform extra operations."""
304
-        LOG.warn(_LW("Join operation not specialized."))
304
+        LOG.warning(_LW("Join operation not specialized."))
305 305
         return True
306 306
 
307 307
     def do_leave(self, obj):
308 308
         """For subclass to override to perform extra operations."""
309
-        LOG.warn(_LW("Join operation not specialized."))
309
+        LOG.warning(_LW("Join operation not specialized."))
310 310
         return True
311 311
 
312 312
     def do_rebuild(self, obj):
313 313
         """For subclass to override."""
314
-        LOG.warn(_LW("Rebuild operation not specialized."))
314
+        LOG.warning(_LW("Rebuild operation not specialized."))
315 315
         return True
316 316
 
317 317
     def do_recover(self, obj, **options):

Loading…
Cancel
Save