diff --git a/glance_store/_drivers/cinder.py b/glance_store/_drivers/cinder.py index 27540176..b84c8b90 100644 --- a/glance_store/_drivers/cinder.py +++ b/glance_store/_drivers/cinder.py @@ -640,7 +640,7 @@ class Store(glance_store.driver.Store): connection_info = volume.initialize_connection(volume, properties) conn = connector.InitiatorConnector.factory( connection_info['driver_volume_type'], root_helper, - conn=connection_info) + conn=connection_info, use_multipath=use_multipath) if connection_info['driver_volume_type'] == 'nfs': if volume.encrypted: volume.unreserve(volume) diff --git a/glance_store/tests/unit/test_cinder_store.py b/glance_store/tests/unit/test_cinder_store.py index 4c4d0d6d..3e52e0a6 100644 --- a/glance_store/tests/unit/test_cinder_store.py +++ b/glance_store/tests/unit/test_cinder_store.py @@ -188,7 +188,7 @@ class TestCinderStore(base.StoreBaseTest, mock.patch.object(cinder.Store, 'get_root_helper', return_value=root_helper), \ mock.patch.object(connector.InitiatorConnector, 'factory', - side_effect=fake_factory): + side_effect=fake_factory) as fake_conn_obj: with mock.patch.object(connector, 'get_connector_properties') as mock_conn: @@ -223,6 +223,9 @@ class TestCinderStore(base.StoreBaseTest, None, 'glance_store', attach_mode, host_name=socket.gethostname()) fake_volumes.detach.assert_called_once_with(fake_volume) + fake_conn_obj.assert_called_once_with( + mock.ANY, root_helper, conn=mock.ANY, + use_multipath=multipath_supported) def test_open_cinder_volume_rw(self): self._test_open_cinder_volume('wb', 'rw', None) diff --git a/glance_store/tests/unit/test_multistore_cinder.py b/glance_store/tests/unit/test_multistore_cinder.py index 484fd4c5..9ab97468 100644 --- a/glance_store/tests/unit/test_multistore_cinder.py +++ b/glance_store/tests/unit/test_multistore_cinder.py @@ -219,7 +219,7 @@ class TestMultiCinderStore(base.MultiStoreBaseTest, mock.patch.object(cinder.Store, 'get_root_helper', return_value=root_helper), \ mock.patch.object(connector.InitiatorConnector, 'factory', - side_effect=fake_factory): + side_effect=fake_factory) as fake_conn_obj: with mock.patch.object(connector, 'get_connector_properties') as mock_conn: @@ -238,6 +238,9 @@ class TestMultiCinderStore(base.MultiStoreBaseTest, None, 'glance_store', attach_mode, host_name=socket.gethostname()) fake_volumes.detach.assert_called_once_with(fake_volume) + fake_conn_obj.assert_called_once_with( + mock.ANY, root_helper, conn=mock.ANY, + use_multipath=multipath_supported) def test_open_cinder_volume_rw(self): self._test_open_cinder_volume('wb', 'rw', None)