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:
Gary Kotton 2016-06-06 05:49:32 -07:00
parent c2f96711af
commit 7f15e34c52
5 changed files with 11 additions and 11 deletions

View File

@ -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):

View File

@ -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,

View File

@ -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):

View File

@ -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):

View File

@ -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):