Replace deprecated LOG.warn with LOG.warning
LOG.warn is deprecated in Python 3 [1] . But it still used in a few places, non-deprecated LOG.warning should be used instead. Note: If we are using logger from oslo.log, warn is still valid [2], but I agree we can switch to LOG.warning. [1]https://docs.python.org/3/library/logging.html#logging.warning [2]https://github.com/openstack/oslo.log/blob/master/oslo_log/log.py#L85 Change-Id: Ibbcc287815cbc06162a13448c2dabcb0748e4e32 Closes-Bug: #1508442
This commit is contained in:
parent
7a2adab56a
commit
8bc3693c19
@ -554,11 +554,11 @@ class RecoverShard(base.Task):
|
||||
|
||||
stale_zones = self.storage.find_zones(self.context, stale_criterion)
|
||||
if stale_zones:
|
||||
LOG.warn('Found %(len)d zones PENDING for more than %(sec)d '
|
||||
'seconds', {
|
||||
'len': len(stale_zones),
|
||||
'sec': self.max_prop_time
|
||||
})
|
||||
LOG.warning('Found %(len)d zones PENDING for more than %(sec)d '
|
||||
'seconds', {
|
||||
'len': len(stale_zones),
|
||||
'sec': self.max_prop_time
|
||||
})
|
||||
error_zones.extend(stale_zones)
|
||||
|
||||
return error_zones
|
||||
|
@ -207,7 +207,7 @@ See https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html
|
||||
LOG.debug("... %s", variable)
|
||||
# Use named interpolation when more than one replacement is done
|
||||
LOG.info("... %(key)s ...", {'key': 'value', ...})
|
||||
LOG.warn("... %(key)s", {'key': 'value'})
|
||||
LOG.warning("... %(key)s", {'key': 'value'})
|
||||
LOG.error("... %(key)s", {'key': 'value'})
|
||||
LOG.critical("... %(key)s", {'key': 'value'})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user