diff --git a/ironic/drivers/modules/ilo/common.py b/ironic/drivers/modules/ilo/common.py index 5cd65b91bc..bc78e189d7 100644 --- a/ironic/drivers/modules/ilo/common.py +++ b/ironic/drivers/modules/ilo/common.py @@ -183,11 +183,11 @@ def remove_image_from_swift(object_name, associated_with=None): swift_api = swift.SwiftAPI() swift_api.delete_object(container, object_name) except exception.SwiftObjectNotFoundError as e: - LOG.warning("Temporary object %(associated_with_msg)s" - "was already deleted from Swift. Error: %(err)s", - {'associated_with_msg': - ("associated with %s " % associated_with - if associated_with else ""), 'err': e}) + LOG.info("Temporary object %(associated_with_msg)s" + "was already deleted from Swift. Error: %(err)s", + {'associated_with_msg': + ("associated with %s " % associated_with + if associated_with else ""), 'err': e}) except exception.SwiftOperationError as e: LOG.exception("Error while deleting temporary swift object " "%(object_name)s %(associated_with_msg)s from " diff --git a/ironic/tests/unit/drivers/modules/ilo/test_common.py b/ironic/tests/unit/drivers/modules/ilo/test_common.py index 80bf84d0d4..56cb290fc1 100644 --- a/ironic/tests/unit/drivers/modules/ilo/test_common.py +++ b/ironic/tests/unit/drivers/modules/ilo/test_common.py @@ -636,7 +636,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase): self.assertTrue(log_mock.called) 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) @mock.patch.object(ilo_common, 'eject_vmedia_devices', spec_set=True, autospec=True) @@ -921,7 +921,7 @@ class IloCommonMethodsTestCase(db_base.DbTestCase): # | WHEN | ilo_common.remove_image_from_swift(object_name) # | THEN | - LOG_mock.warning.assert_called_once_with( + LOG_mock.info.assert_called_once_with( mock.ANY, {'associated_with_msg': "", 'err': raised_exc}) @mock.patch.object(ilo_common, 'LOG', spec_set=True, autospec=True) diff --git a/releasenotes/notes/fix-ilo-drivers-log-message-c3c64c1ca0a0bca8.yaml b/releasenotes/notes/fix-ilo-drivers-log-message-c3c64c1ca0a0bca8.yaml new file mode 100644 index 0000000000..6cf8e75447 --- /dev/null +++ b/releasenotes/notes/fix-ilo-drivers-log-message-c3c64c1ca0a0bca8.yaml @@ -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``.