diff options
author | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2015-12-29 12:35:37 +0800 |
---|---|---|
committer | ChangBo Guo(gcb) <eric.guo@easystack.cn> | 2015-12-29 12:35:37 +0800 |
commit | a89ac06029d306fc23095b1dbb317b2751b07075 (patch) | |
tree | b8fcb1dc31fce326fd5eef64a7f32494218af184 /oslo_vmware/api.py | |
parent | 342b0913b4239d08e35c8f64a0589d5ce8f10509 (diff) | |
download | oslo-vmware-a89ac06029d306fc23095b1dbb317b2751b07075.tar.gz |
Python 3 deprecated the logger.warn method in favor of warning2.2.1
According to https://docs.python.org/3/library/logging.html#logging.warning,
We prefer to use warning to avoid DeprecationWarning.
Change-Id: I29e960b3ba179e0701a57aee84cff6bdf4105db5
Diffstat (limited to 'oslo_vmware/api.py')
-rw-r--r-- | oslo_vmware/api.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/oslo_vmware/api.py b/oslo_vmware/api.py index cada825..4dd2752 100644 --- a/oslo_vmware/api.py +++ b/oslo_vmware/api.py @@ -95,11 +95,11 @@ class RetryDecorator(object): result = f(*args, **kwargs) except self._exceptions: with excutils.save_and_reraise_exception() as ctxt: - LOG.warn(_LW("Exception which is in the suggested list of " - "exceptions occurred while invoking function:" - " %s."), - func_name, - exc_info=True) + LOG.warning(_LW("Exception which is in the suggested list " + "of exceptions occurred while invoking " + "function: %s."), + func_name, + exc_info=True) if (self._max_retry_count != -1 and self._retry_count >= self._max_retry_count): LOG.error(_LE("Cannot retry upon suggested exception " @@ -494,8 +494,8 @@ class VMwareAPISession(object): lease, 'error') except exceptions.VimException: - LOG.warn(_LW("Error occurred while reading error message for " - "lease: %s."), - lease, - exc_info=True) + LOG.warning(_LW("Error occurred while reading error message for " + "lease: %s."), + lease, + exc_info=True) return "Unknown" |