Merge "Changes log level of a message"
This commit is contained in:
commit
1d1f2d92a8
@ -183,11 +183,11 @@ def remove_image_from_swift(object_name, associated_with=None):
|
|||||||
swift_api = swift.SwiftAPI()
|
swift_api = swift.SwiftAPI()
|
||||||
swift_api.delete_object(container, object_name)
|
swift_api.delete_object(container, object_name)
|
||||||
except exception.SwiftObjectNotFoundError as e:
|
except exception.SwiftObjectNotFoundError as e:
|
||||||
LOG.warning("Temporary object %(associated_with_msg)s"
|
LOG.info("Temporary object %(associated_with_msg)s"
|
||||||
"was already deleted from Swift. Error: %(err)s",
|
"was already deleted from Swift. Error: %(err)s",
|
||||||
{'associated_with_msg':
|
{'associated_with_msg':
|
||||||
("associated with %s " % associated_with
|
("associated with %s " % associated_with
|
||||||
if associated_with else ""), 'err': e})
|
if associated_with else ""), 'err': e})
|
||||||
except exception.SwiftOperationError as e:
|
except exception.SwiftOperationError as e:
|
||||||
LOG.exception("Error while deleting temporary swift object "
|
LOG.exception("Error while deleting temporary swift object "
|
||||||
"%(object_name)s %(associated_with_msg)s from "
|
"%(object_name)s %(associated_with_msg)s from "
|
||||||
|
@ -636,7 +636,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||||||
self.assertTrue(log_mock.called)
|
self.assertTrue(log_mock.called)
|
||||||
eject_mock.assert_called_once_with(task)
|
eject_mock.assert_called_once_with(task)
|
||||||
|
|
||||||
@mock.patch.object(ilo_common.LOG, 'warning', spec_set=True,
|
@mock.patch.object(ilo_common.LOG, 'info', spec_set=True,
|
||||||
autospec=True)
|
autospec=True)
|
||||||
@mock.patch.object(ilo_common, 'eject_vmedia_devices',
|
@mock.patch.object(ilo_common, 'eject_vmedia_devices',
|
||||||
spec_set=True, autospec=True)
|
spec_set=True, autospec=True)
|
||||||
@ -921,7 +921,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase):
|
|||||||
# | WHEN |
|
# | WHEN |
|
||||||
ilo_common.remove_image_from_swift(object_name)
|
ilo_common.remove_image_from_swift(object_name)
|
||||||
# | THEN |
|
# | THEN |
|
||||||
LOG_mock.warning.assert_called_once_with(
|
LOG_mock.info.assert_called_once_with(
|
||||||
mock.ANY, {'associated_with_msg': "", 'err': raised_exc})
|
mock.ANY, {'associated_with_msg': "", 'err': raised_exc})
|
||||||
|
|
||||||
@mock.patch.object(ilo_common, 'LOG', spec_set=True, autospec=True)
|
@mock.patch.object(ilo_common, 'LOG', spec_set=True, autospec=True)
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
When the deletion of a swift temporary object fails because the
|
||||||
|
object is no longer available in swift, a message is logged.
|
||||||
|
The log level of this message was changed from ``warning`` to
|
||||||
|
``info``.
|
Loading…
x
Reference in New Issue
Block a user