Using LOG.warning instead of LOG.warn
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: Iac71d0c6d4209c236f4a4149eec0d08ec1682271
This commit is contained in:
parent
c2f96711af
commit
7f15e34c52
@ -152,8 +152,8 @@ class EtcdLock(locking.Lock):
|
||||
self._node = None
|
||||
return True
|
||||
else:
|
||||
LOG.warn("Unable to release '%s' due to %d, %s",
|
||||
self.name, errorcode, reply.get('message'))
|
||||
LOG.warning("Unable to release '%s' due to %d, %s",
|
||||
self.name, errorcode, reply.get('message'))
|
||||
return False
|
||||
|
||||
@_translate_failures
|
||||
@ -164,9 +164,9 @@ class EtcdLock(locking.Lock):
|
||||
"prevExist": "true"}, make_url=False)
|
||||
errorcode = poked.get("errorCode")
|
||||
if errorcode:
|
||||
LOG.warn("Unable to heartbeat by updating key '%s' with extended"
|
||||
" expiry of %s seconds: %d, %s", self.name, self.ttl,
|
||||
errorcode, poked.get("message"))
|
||||
LOG.warning("Unable to heartbeat by updating key '%s' with "
|
||||
"extended expiry of %s seconds: %d, %s", self.name,
|
||||
self.ttl, errorcode, poked.get("message"))
|
||||
|
||||
|
||||
class EtcdDriver(coordination.CoordinationDriver):
|
||||
|
@ -181,7 +181,7 @@ class FileLock(locking.Lock):
|
||||
|
||||
def __del__(self):
|
||||
if self.acquired:
|
||||
LOG.warn("Unreleased lock %s garbage collected", self.name)
|
||||
LOG.warning("Unreleased lock %s garbage collected", self.name)
|
||||
|
||||
|
||||
class FileDriver(coordination._RunWatchersMixin,
|
||||
|
@ -157,9 +157,9 @@ class MemcachedLock(locking.Lock):
|
||||
expire=self.timeout,
|
||||
noreply=False)
|
||||
if not poked:
|
||||
LOG.warn("Unable to heartbeat by updating key '%s' with"
|
||||
" extended expiry of %s seconds", self.name,
|
||||
self.timeout)
|
||||
LOG.warning("Unable to heartbeat by updating key '%s' with "
|
||||
"extended expiry of %s seconds", self.name,
|
||||
self.timeout)
|
||||
|
||||
@_translate_failures
|
||||
def get_owner(self):
|
||||
|
@ -90,7 +90,7 @@ class MySQLLock(locking.Lock):
|
||||
|
||||
def __del__(self):
|
||||
if self.acquired:
|
||||
LOG.warn("unreleased lock %s garbage collected" % self.name)
|
||||
LOG.warning("unreleased lock %s garbage collected", self.name)
|
||||
|
||||
|
||||
class MySQLDriver(coordination.CoordinationDriver):
|
||||
|
@ -146,7 +146,7 @@ class PostgresLock(locking.Lock):
|
||||
|
||||
def __del__(self):
|
||||
if self.acquired:
|
||||
LOG.warn("unreleased lock %s garbage collected" % self.name)
|
||||
LOG.warning("unreleased lock %s garbage collected", self.name)
|
||||
|
||||
|
||||
class PostgresDriver(coordination.CoordinationDriver):
|
||||
|
Loading…
x
Reference in New Issue
Block a user