diff --git a/glance_store/_drivers/filesystem.py b/glance_store/_drivers/filesystem.py index 80a7a558..f67152c1 100644 --- a/glance_store/_drivers/filesystem.py +++ b/glance_store/_drivers/filesystem.py @@ -211,8 +211,9 @@ class Store(glance_store.driver.Store): # chmod g+x os.chmod(datadir, mode | stat.S_IXGRP) except (IOError, OSError): - LOG.warn(_LW("Unable to set execution permission of owner-group " - "and/or other-users to datadir: %s") % datadir) + LOG.warning(_LW("Unable to set execution permission of " + "owner-group and/or other-users to datadir: %s") + % datadir) def _create_image_directories(self, directory_paths): """ @@ -631,8 +632,8 @@ class Store(glance_store.driver.Store): try: os.chmod(filepath, perm) except (IOError, OSError): - LOG.warn(_LW("Unable to set permission to image: %s") % - filepath) + LOG.warning(_LW("Unable to set permission to image: %s") % + filepath) return ('file://%s' % filepath, bytes_written, checksum_hex, metadata) diff --git a/glance_store/_drivers/swift/store.py b/glance_store/_drivers/swift/store.py index f63c1eaf..e87e0f9d 100644 --- a/glance_store/_drivers/swift/store.py +++ b/glance_store/_drivers/swift/store.py @@ -147,8 +147,9 @@ def swift_retry_iter(resp_iter, length, store, location, context): yield chunk bytes_read += len(chunk) except swiftclient.ClientException as e: - LOG.warn(_("Swift exception raised %s") - % encodeutils.exception_to_unicode(e)) + LOG.warning(_("Swift exception raised %s") + + % encodeutils.exception_to_unicode(e)) if bytes_read != length: if retries == store.conf.glance_store.swift_store_retry_get_count: @@ -437,7 +438,7 @@ class BaseStore(driver.Store): except swiftclient.ClientException as e: if e.http_status == http_client.NOT_FOUND: msg = _("Swift could not find object %s.") % location.obj - LOG.warn(msg) + LOG.warning(msg) raise exceptions.NotFound(message=msg) else: raise diff --git a/glance_store/_drivers/vmware_datastore.py b/glance_store/_drivers/vmware_datastore.py index 14cbff82..482f2fd0 100644 --- a/glance_store/_drivers/vmware_datastore.py +++ b/glance_store/_drivers/vmware_datastore.py @@ -559,7 +559,7 @@ class Store(glance_store.Store): self.session.wait_for_task(delete_task) except vexc.FileNotFoundException: msg = _('Image file %s not found') % file_path - LOG.warn(msg) + LOG.warning(msg) raise exceptions.NotFound(message=msg) except Exception: with excutils.save_and_reraise_exception(): diff --git a/glance_store/backend.py b/glance_store/backend.py index 7fb4e61c..299b5082 100644 --- a/glance_store/backend.py +++ b/glance_store/backend.py @@ -155,8 +155,8 @@ def _load_store(conf, store_entry, invoke_load=True): invoke_on_load=invoke_load) return mgr.driver except RuntimeError as e: - LOG.warn("Failed to load driver %(driver)s." - "The driver will be disabled" % dict(driver=str([driver, e]))) + LOG.warning("Failed to load driver %(driver)s. The " + "driver will be disabled" % dict(driver=str([driver, e]))) def _load_stores(conf): diff --git a/glance_store/capabilities.py b/glance_store/capabilities.py index a1c64cec..8da8ce3a 100644 --- a/glance_store/capabilities.py +++ b/glance_store/capabilities.py @@ -215,8 +215,8 @@ def check(store_op_fun): try: req_cap = op_cap_map[op] except KeyError: - LOG.warn(_LW('The capability of operation "%s" ' - 'could not be checked.'), op) + LOG.warning(_LW('The capability of operation "%s" ' + 'could not be checked.'), op) else: if not store.is_capable(*req_cap): kwargs.setdefault('offset', 0) diff --git a/glance_store/driver.py b/glance_store/driver.py index eb200b45..7bb1fd4b 100644 --- a/glance_store/driver.py +++ b/glance_store/driver.py @@ -69,7 +69,7 @@ class Store(capabilities.StoreCapability): msg = (_(u"Failed to configure store correctly: %s " "Disabling add method.") % encodeutils.exception_to_unicode(e)) - LOG.warn(msg) + LOG.warning(msg) if re_raise_bsc: raise finally: diff --git a/glance_store/tests/unit/test_store_base.py b/glance_store/tests/unit/test_store_base.py index 4b40b5a7..5917220b 100644 --- a/glance_store/tests/unit/test_store_base.py +++ b/glance_store/tests/unit/test_store_base.py @@ -31,4 +31,4 @@ class TestStoreBase(base.StoreBaseTest): self.config(stores=['file'], group='glance_store') for (__, store_instance) in backend._load_stores(self.conf): store_instance.configure() - self.assertTrue(mock_log.warn.called) + self.assertTrue(mock_log.warning.called)