Merge "Cinder: Correct exception logging during attach"
commit
111a7a14b0
|
@ -190,8 +190,8 @@ class _AttachmentState(object):
|
|||
attachment = self.volume_api.attachment_create(
|
||||
client, volume_id, mode=mode)
|
||||
except Exception:
|
||||
LOG.exception(_LE('Error attaching volume %(volume_id)s',
|
||||
{'volume_id': volume_id}))
|
||||
LOG.exception(_LE('Error attaching volume %(volume_id)s'),
|
||||
{'volume_id': volume_id})
|
||||
del self.volumes[volume_id]
|
||||
raise
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ from unittest import mock
|
|||
from oslo_config import cfg
|
||||
from oslotest import base
|
||||
|
||||
from cinderclient import exceptions as cinder_exception
|
||||
from glance_store.common import attachment_state_manager as attach_manager
|
||||
from glance_store.common import cinder_utils
|
||||
from glance_store import exceptions
|
||||
|
@ -106,3 +107,11 @@ class AttachmentStateTestCase(base.BaseTestCase):
|
|||
*self.disconnect_vol_call)
|
||||
mock_attach_delete.assert_called_once_with(
|
||||
*self.detach_call)
|
||||
|
||||
@mock.patch.object(cinder_utils.API, 'attachment_create')
|
||||
def test_attach_fails(self, mock_attach_create):
|
||||
mock_attach_create.side_effect = cinder_exception.BadRequest(code=400)
|
||||
self.assertRaises(
|
||||
cinder_exception.BadRequest, self.m.attach,
|
||||
mock.sentinel.client, mock.sentinel.volume_id,
|
||||
mock.sentinel.host, mode=mock.sentinel.mode)
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
`Bug #1970698 <https://bugs.launchpad.net/glance-store/+bug/1970698>`_:
|
||||
Cinder: Fixed exception logging when the image create operation fails
|
||||
due to failing to attach volume to glance host.
|
Loading…
Reference in New Issue