LOG.warn is deprecated in python3
Replace LOG.warn with LOG.warning cause it has been deprecated in py3 and oslo_lod is not used to encapsulate this change. Co-Authored-By: kairat_kushaev <kkushaev@mirantis.com> Change-Id: I31b3f491b5d242abea4e5a7728983142ad2805a8
This commit is contained in:
parent
88c4a75366
commit
d413f0d062
|
@ -211,8 +211,9 @@ class Store(glance_store.driver.Store):
|
||||||
# chmod g+x
|
# chmod g+x
|
||||||
os.chmod(datadir, mode | stat.S_IXGRP)
|
os.chmod(datadir, mode | stat.S_IXGRP)
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
LOG.warn(_LW("Unable to set execution permission of owner-group "
|
LOG.warning(_LW("Unable to set execution permission of "
|
||||||
"and/or other-users to datadir: %s") % datadir)
|
"owner-group and/or other-users to datadir: %s")
|
||||||
|
% datadir)
|
||||||
|
|
||||||
def _create_image_directories(self, directory_paths):
|
def _create_image_directories(self, directory_paths):
|
||||||
"""
|
"""
|
||||||
|
@ -631,8 +632,8 @@ class Store(glance_store.driver.Store):
|
||||||
try:
|
try:
|
||||||
os.chmod(filepath, perm)
|
os.chmod(filepath, perm)
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
LOG.warn(_LW("Unable to set permission to image: %s") %
|
LOG.warning(_LW("Unable to set permission to image: %s") %
|
||||||
filepath)
|
filepath)
|
||||||
|
|
||||||
return ('file://%s' % filepath, bytes_written, checksum_hex, metadata)
|
return ('file://%s' % filepath, bytes_written, checksum_hex, metadata)
|
||||||
|
|
||||||
|
|
|
@ -147,8 +147,9 @@ def swift_retry_iter(resp_iter, length, store, location, context):
|
||||||
yield chunk
|
yield chunk
|
||||||
bytes_read += len(chunk)
|
bytes_read += len(chunk)
|
||||||
except swiftclient.ClientException as e:
|
except swiftclient.ClientException as e:
|
||||||
LOG.warn(_("Swift exception raised %s")
|
LOG.warning(_("Swift exception raised %s")
|
||||||
% encodeutils.exception_to_unicode(e))
|
|
||||||
|
% encodeutils.exception_to_unicode(e))
|
||||||
|
|
||||||
if bytes_read != length:
|
if bytes_read != length:
|
||||||
if retries == store.conf.glance_store.swift_store_retry_get_count:
|
if retries == store.conf.glance_store.swift_store_retry_get_count:
|
||||||
|
@ -437,7 +438,7 @@ class BaseStore(driver.Store):
|
||||||
except swiftclient.ClientException as e:
|
except swiftclient.ClientException as e:
|
||||||
if e.http_status == http_client.NOT_FOUND:
|
if e.http_status == http_client.NOT_FOUND:
|
||||||
msg = _("Swift could not find object %s.") % location.obj
|
msg = _("Swift could not find object %s.") % location.obj
|
||||||
LOG.warn(msg)
|
LOG.warning(msg)
|
||||||
raise exceptions.NotFound(message=msg)
|
raise exceptions.NotFound(message=msg)
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
|
@ -559,7 +559,7 @@ class Store(glance_store.Store):
|
||||||
self.session.wait_for_task(delete_task)
|
self.session.wait_for_task(delete_task)
|
||||||
except vexc.FileNotFoundException:
|
except vexc.FileNotFoundException:
|
||||||
msg = _('Image file %s not found') % file_path
|
msg = _('Image file %s not found') % file_path
|
||||||
LOG.warn(msg)
|
LOG.warning(msg)
|
||||||
raise exceptions.NotFound(message=msg)
|
raise exceptions.NotFound(message=msg)
|
||||||
except Exception:
|
except Exception:
|
||||||
with excutils.save_and_reraise_exception():
|
with excutils.save_and_reraise_exception():
|
||||||
|
|
|
@ -155,8 +155,8 @@ def _load_store(conf, store_entry, invoke_load=True):
|
||||||
invoke_on_load=invoke_load)
|
invoke_on_load=invoke_load)
|
||||||
return mgr.driver
|
return mgr.driver
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
LOG.warn("Failed to load driver %(driver)s."
|
LOG.warning("Failed to load driver %(driver)s. The "
|
||||||
"The driver will be disabled" % dict(driver=str([driver, e])))
|
"driver will be disabled" % dict(driver=str([driver, e])))
|
||||||
|
|
||||||
|
|
||||||
def _load_stores(conf):
|
def _load_stores(conf):
|
||||||
|
|
|
@ -215,8 +215,8 @@ def check(store_op_fun):
|
||||||
try:
|
try:
|
||||||
req_cap = op_cap_map[op]
|
req_cap = op_cap_map[op]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
LOG.warn(_LW('The capability of operation "%s" '
|
LOG.warning(_LW('The capability of operation "%s" '
|
||||||
'could not be checked.'), op)
|
'could not be checked.'), op)
|
||||||
else:
|
else:
|
||||||
if not store.is_capable(*req_cap):
|
if not store.is_capable(*req_cap):
|
||||||
kwargs.setdefault('offset', 0)
|
kwargs.setdefault('offset', 0)
|
||||||
|
|
|
@ -69,7 +69,7 @@ class Store(capabilities.StoreCapability):
|
||||||
msg = (_(u"Failed to configure store correctly: %s "
|
msg = (_(u"Failed to configure store correctly: %s "
|
||||||
"Disabling add method.")
|
"Disabling add method.")
|
||||||
% encodeutils.exception_to_unicode(e))
|
% encodeutils.exception_to_unicode(e))
|
||||||
LOG.warn(msg)
|
LOG.warning(msg)
|
||||||
if re_raise_bsc:
|
if re_raise_bsc:
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
|
|
|
@ -31,4 +31,4 @@ class TestStoreBase(base.StoreBaseTest):
|
||||||
self.config(stores=['file'], group='glance_store')
|
self.config(stores=['file'], group='glance_store')
|
||||||
for (__, store_instance) in backend._load_stores(self.conf):
|
for (__, store_instance) in backend._load_stores(self.conf):
|
||||||
store_instance.configure()
|
store_instance.configure()
|
||||||
self.assertTrue(mock_log.warn.called)
|
self.assertTrue(mock_log.warning.called)
|
||||||
|
|
Loading…
Reference in New Issue