cinder: Specify mountpoint host param to attach API

When an image data is uploaded to cinder backend, it causes the
following error:
  glance_store._drivers.cinder BadRequest:
  Invalid input for field/attribute mountpoint.

This is due to cinder require the mountpoint param on attach API.

Change-Id: Ie82e9f4f3848cebe54f4dbccb9018815a0d5ebf1
Closes-Bug: #1779455
This commit is contained in:
Tomoki Sekiyama 2018-06-30 07:34:08 -04:00
parent 5a20d47cd3
commit 68784feef2
2 changed files with 3 additions and 2 deletions

View File

@ -492,7 +492,7 @@ class Store(glance_store.driver.Store):
connection_info['driver_volume_type'], root_helper,
conn=connection_info)
device = conn.connect_volume(connection_info['data'])
volume.attach(None, None, attach_mode, host_name=host)
volume.attach(None, 'glance_store', attach_mode, host_name=host)
volume = self._wait_volume_status(volume, 'attaching', 'in-use')
if (connection_info['driver_volume_type'] == 'rbd' and
not conn.do_local_attach):

View File

@ -179,7 +179,8 @@ class TestCinderStore(base.StoreBaseTest,
fake_connector.disconnect_volume.assert_called_once_with(
mock.ANY, fake_devinfo)
fake_volume.attach.assert_called_once_with(
None, None, attach_mode, host_name=socket.gethostname())
None, 'glance_store', attach_mode,
host_name=socket.gethostname())
fake_volumes.detach.assert_called_once_with(fake_volume)
def test_open_cinder_volume_rw(self):