summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-12 02:05:24 +0000
committerGerrit Code Review <review@openstack.org>2016-02-12 02:05:24 +0000
commit36fdb5743e06b18626dd9026e0a9db4dddbe2325 (patch)
treebd5503a040783202968903e98168400ca1768bd4
parenta004db93d2db07b5ee49ad2384fab475a1917386 (diff)
parentd413f0d062eb6370df9b308b1cc6891e9857610d (diff)
downloadglance_store-36fdb5743e06b18626dd9026e0a9db4dddbe2325.tar.gz
Merge "LOG.warn is deprecated in python3"
-rw-r--r--glance_store/_drivers/filesystem.py9
-rw-r--r--glance_store/_drivers/swift/store.py7
-rw-r--r--glance_store/_drivers/vmware_datastore.py2
-rw-r--r--glance_store/backend.py4
-rw-r--r--glance_store/capabilities.py4
-rw-r--r--glance_store/driver.py2
-rw-r--r--glance_store/tests/unit/test_store_base.py2
7 files changed, 16 insertions, 14 deletions
diff --git a/glance_store/_drivers/filesystem.py b/glance_store/_drivers/filesystem.py
index 80a7a55..f67152c 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 f63c1ea..e87e0f9 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 14cbff8..482f2fd 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 7fb4e61..299b508 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 a1c64ce..8da8ce3 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 eb200b4..7bb1fd4 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 4b40b5a..5917220 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)