Change LOG.warn to LOG.warning

Python 3 deprecated the logger.warn method, see:
https://docs.python.org/3/library/logging.html#logging.warning
so we prefer to use warning to avoid DeprecationWarning.

Change-Id: Ic7496d4dc765586e1bc79c3202b80c444443faf0
Closes-Bug: #1530742
This commit is contained in:
zhurong 2015-12-22 09:40:07 +08:00
parent 500a075963
commit b3cde50695
2 changed files with 4 additions and 3 deletions

View File

@ -352,7 +352,7 @@ class Server(object):
self.stale_children.remove(pid)
LOG.info(_LI('Removed stale child %s'), pid)
else:
LOG.warn(_LW('Unrecognised child %s'), pid)
LOG.warning(_LW('Unrecognized child %s'), pid)
def _verify_and_respawn_children(self, pid, status):
if len(self.stale_children) == 0:

View File

@ -83,7 +83,7 @@ class Registry(object):
registry = self._registry
if info is None:
# delete this entry.
LOG.warn(_LW('Removing %(item)s from registry'), {'item': name})
LOG.warning(_LW('Removing %(item)s from registry'), {'item': name})
registry.pop(name, None)
return
@ -95,7 +95,8 @@ class Registry(object):
'old': str(registry[name].plugin),
'new': str(info.plugin)
}
LOG.warn(_LW('Changing %(name)s from %(old)s to %(new)s'), details)
LOG.warning(_LW('Changing %(name)s from %(old)s to %(new)s'),
details)
else:
LOG.info(_LI('Registering %(name)s -> %(value)s'), {
'name': name, 'value': str(info.plugin)})