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
This commit is contained in:
yatin karel 2016-07-16 18:20:18 +05:30
parent 9fbacd2300
commit f11fe2e82f
2 changed files with 13 additions and 11 deletions

View File

@ -52,8 +52,8 @@ class NotificationEndpoint(object):
def warn(self, ctxt, publisher_id, event_type, payload, metadata): def warn(self, ctxt, publisher_id, event_type, payload, metadata):
metadata = payload['metadata'] metadata = payload['metadata']
if 'cluster' in metadata and metadata['cluster'] == self.cluster_id: if 'cluster' in metadata and metadata['cluster'] == self.cluster_id:
LOG.warn("publisher=%s" % publisher_id) LOG.warning("publisher=%s" % publisher_id)
LOG.warn("event_type=%s" % event_type) LOG.warning("event_type=%s" % event_type)
def debug(self, ctxt, publisher_id, event_type, payload, metadata): def debug(self, ctxt, publisher_id, event_type, payload, metadata):
metadata = payload['metadata'] metadata = payload['metadata']
@ -117,7 +117,7 @@ class HealthManager(service.Service):
""" """
cluster = objects.Cluster.get(self.ctx, cluster_id) cluster = objects.Cluster.get(self.ctx, cluster_id)
if not cluster: if not cluster:
LOG.warn(_LW("Cluster (%s) is not found."), cluster_id) LOG.warning(_LW("Cluster (%s) is not found."), cluster_id)
return return
project = cluster.project project = cluster.project
@ -143,8 +143,10 @@ class HealthManager(service.Service):
else: else:
return None return None
else: else:
LOG.warn(_LW("Cluster (%(id)s) check type (%(type)s) is invalid."), LOG.warning(_LW("Cluster (%(id)s) check type (%(type)s) is "
{'id': entry['cluster_id'], 'type': entry['check_type']}) "invalid."),
{'id': entry['cluster_id'],
'type': entry['check_type']})
return None return None
return entry return entry

View File

@ -286,32 +286,32 @@ class Profile(object):
def do_update(self, obj, new_profile, **params): def do_update(self, obj, new_profile, **params):
"""For subclass to override.""" """For subclass to override."""
LOG.warn(_LW("Update operation not supported.")) LOG.warning(_LW("Update operation not supported."))
return True return True
def do_check(self, obj): def do_check(self, obj):
"""For subclass to override.""" """For subclass to override."""
LOG.warn(_LW("Check operation not supported.")) LOG.warning(_LW("Check operation not supported."))
return True return True
def do_get_details(self, obj): def do_get_details(self, obj):
"""For subclass to override.""" """For subclass to override."""
LOG.warn(_LW("Get_details operation not supported.")) LOG.warning(_LW("Get_details operation not supported."))
return {} return {}
def do_join(self, obj, cluster_id): def do_join(self, obj, cluster_id):
"""For subclass to override to perform extra operations.""" """For subclass to override to perform extra operations."""
LOG.warn(_LW("Join operation not specialized.")) LOG.warning(_LW("Join operation not specialized."))
return True return True
def do_leave(self, obj): def do_leave(self, obj):
"""For subclass to override to perform extra operations.""" """For subclass to override to perform extra operations."""
LOG.warn(_LW("Join operation not specialized.")) LOG.warning(_LW("Join operation not specialized."))
return True return True
def do_rebuild(self, obj): def do_rebuild(self, obj):
"""For subclass to override.""" """For subclass to override."""
LOG.warn(_LW("Rebuild operation not specialized.")) LOG.warning(_LW("Rebuild operation not specialized."))
return True return True
def do_recover(self, obj, **options): def do_recover(self, obj, **options):