Merge "Correct attachment_complete call"

This commit is contained in:
Zuul 2022-01-07 16:49:03 +00:00 committed by Gerrit Code Review
commit 16b9d1f7ad
3 changed files with 4 additions and 5 deletions

View File

@ -717,7 +717,6 @@ class Store(glance_store.driver.Store):
attachment = self.volume_api.attachment_update(
client, attachment['id'], connector_prop,
mountpoint='glance_store')
self.volume_api.attachment_complete(client, attachment.id)
volume = volume.manager.get(volume_id)
connection_info = attachment.connection_info
@ -758,6 +757,10 @@ class Store(glance_store.driver.Store):
device = connect_volume_nfs()
else:
device = conn.connect_volume(connection_info)
# Complete the attachment (marking the volume "in-use") after
# the connection with os-brick is complete
self.volume_api.attachment_complete(client, attachment.id)
if (connection_info['driver_volume_type'] == 'rbd' and
not conn.do_local_attach):
yield device['path']

View File

@ -291,8 +291,6 @@ class TestCinderStore(base.StoreBaseTest,
attach_update.assert_called_once_with(
fake_client, fake_attachment_id,
fake_conn_info, mountpoint='glance_store')
attach_complete.assert_called_once_with(
fake_client, fake_attachment_id)
attach_delete.assert_called_once_with(
fake_client, fake_attachment_id)

View File

@ -324,8 +324,6 @@ class TestMultiCinderStore(base.MultiStoreBaseTest,
attach_update.assert_called_once_with(
fake_client, fake_attachment_id,
fake_conn_info, mountpoint='glance_store')
attach_complete.assert_called_once_with(
fake_client, fake_attachment_id)
attach_delete.assert_called_once_with(
fake_client, fake_attachment_id)