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" diff --git a/oslo_vmware/common/loopingcall.py b/oslo_vmware/common/loopingcall.py index 1db1f21..c4a16ae 100644 --- a/oslo_vmware/common/loopingcall.py +++ b/oslo_vmware/common/loopingcall.py @@ -79,8 +79,9 @@ class FixedIntervalLoopingCall(LoopingCallBase): break delay = interval - timeutils.delta_seconds(start, end) if delay <= 0: - LOG.warn(_LW('task run outlasted interval by %s sec'), - -delay) + LOG.warning(_LW('task run outlasted interval ' + 'by %s sec'), + -delay) greenthread.sleep(delay if delay > 0 else 0) except LoopingCallDone as e: self.stop() diff --git a/oslo_vmware/exceptions.py b/oslo_vmware/exceptions.py index 1b6b115..aa57133 100644 --- a/oslo_vmware/exceptions.py +++ b/oslo_vmware/exceptions.py @@ -168,8 +168,8 @@ class ImageTransferException(VMwareDriverException): def _print_deprecation_warning(clazz): - LOG.warn(_LW("Exception %s is deprecated, it will be removed in the " - "next release."), clazz.__name__) + LOG.warning(_LW("Exception %s is deprecated, it will be removed in the " + "next release."), clazz.__name__) class VMwareDriverConfigurationException(VMwareDriverException): diff --git a/oslo_vmware/pbm.py b/oslo_vmware/pbm.py index e4d3643..8a5fe54 100644 --- a/oslo_vmware/pbm.py +++ b/oslo_vmware/pbm.py @@ -196,7 +196,7 @@ def get_pbm_wsdl_location(vc_version): pbm_service_wsdl = os.path.join(curr_dir, 'wsdl', major_minor, 'pbmService.wsdl') if not os.path.exists(pbm_service_wsdl): - LOG.warn(_LW("PBM WSDL file %s not found."), pbm_service_wsdl) + LOG.warning(_LW("PBM WSDL file %s not found."), pbm_service_wsdl) return pbm_wsdl = urlparse.urljoin('file:', urllib.pathname2url(pbm_service_wsdl)) LOG.debug("Using PBM WSDL location: %s.", pbm_wsdl) diff --git a/oslo_vmware/rw_handles.py b/oslo_vmware/rw_handles.py index 160dd2c..754dd17 100644 --- a/oslo_vmware/rw_handles.py +++ b/oslo_vmware/rw_handles.py @@ -152,8 +152,8 @@ class FileHandle(object): try: self._file_handle.close() except Exception: - LOG.warn(_LW("Error occurred while closing the file handle"), - exc_info=True) + LOG.warning(_LW("Error occurred while closing the file handle"), + exc_info=True) def _build_vim_cookie_header(self, vim_cookies): """Build ESX host session cookie header.""" @@ -300,8 +300,8 @@ class FileWriteHandle(FileHandle): try: self._conn.getresponse() except Exception: - LOG.warn(_LW("Error occurred while reading the HTTP response."), - exc_info=True) + LOG.warning(_LW("Error occurred while reading the HTTP response."), + exc_info=True) super(FileWriteHandle, self).close() def __str__(self): @@ -473,9 +473,10 @@ class VmdkWriteHandle(FileHandle): {'url': self._url, 'state': state}) except exceptions.VimException: - LOG.warn(_LW("Error occurred while releasing the lease for %s."), - self._url, - exc_info=True) + LOG.warning(_LW("Error occurred while releasing the lease " + "for %s."), + self._url, + exc_info=True) super(VmdkWriteHandle, self).close() LOG.debug("Closed VMDK write handle for %s.", self._url) @@ -611,9 +612,10 @@ class VmdkReadHandle(FileHandle): {'url': self._url, 'state': state}) except exceptions.VimException: - LOG.warn(_LW("Error occurred while releasing the lease for %s."), - self._url, - exc_info=True) + LOG.warning(_LW("Error occurred while releasing the lease " + "for %s."), + self._url, + exc_info=True) raise super(VmdkReadHandle, self).close() LOG.debug("Closed VMDK read handle for %s.", self._url)