diff options
| author | Gary Kotton <gkotton@vmware.com> | 2016-06-06 05:49:32 -0700 |
|---|---|---|
| committer | Gary Kotton <gkotton@vmware.com> | 2016-06-06 05:51:11 -0700 |
| commit | 7f15e34c5269bc9ad3ecb56c9dedccd55e31032e (patch) | |
| tree | 21d23e8c564f709253838fcffb9216bccfa7a60e | |
| parent | c2f96711af1178056952715176a017c09487ba26 (diff) | |
| download | tooz-1.38.0.tar.gz | |
Using LOG.warning instead of LOG.warn1.38.0
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
| -rw-r--r-- | tooz/drivers/etcd.py | 10 | ||||
| -rw-r--r-- | tooz/drivers/file.py | 2 | ||||
| -rw-r--r-- | tooz/drivers/memcached.py | 6 | ||||
| -rw-r--r-- | tooz/drivers/mysql.py | 2 | ||||
| -rw-r--r-- | tooz/drivers/pgsql.py | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/tooz/drivers/etcd.py b/tooz/drivers/etcd.py index 39d1222..81fb179 100644 --- a/tooz/drivers/etcd.py +++ b/tooz/drivers/etcd.py @@ -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): diff --git a/tooz/drivers/file.py b/tooz/drivers/file.py index 8eb531a..e6b92b2 100644 --- a/tooz/drivers/file.py +++ b/tooz/drivers/file.py @@ -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, diff --git a/tooz/drivers/memcached.py b/tooz/drivers/memcached.py index a998ade..f735213 100644 --- a/tooz/drivers/memcached.py +++ b/tooz/drivers/memcached.py @@ -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): diff --git a/tooz/drivers/mysql.py b/tooz/drivers/mysql.py index 7680993..cab05ff 100644 --- a/tooz/drivers/mysql.py +++ b/tooz/drivers/mysql.py @@ -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): diff --git a/tooz/drivers/pgsql.py b/tooz/drivers/pgsql.py index 8ff2317..e843dd3 100644 --- a/tooz/drivers/pgsql.py +++ b/tooz/drivers/pgsql.py @@ -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): |
