Merge "Remove a dead cinder v1 check"

This commit is contained in:
Jenkins 2017-03-11 03:11:56 +00:00 committed by Gerrit Code Review
commit 5ce3fada48
2 changed files with 0 additions and 15 deletions

View File

@ -281,17 +281,6 @@ class CinderApiTestCase(test.NoDBTestCase):
mock_volumes.attach.assert_called_once_with('id1', 'uuid', 'point',
mode='ro')
@mock.patch('nova.volume.cinder.cinderclient')
def test_detach_v1(self, mock_cinderclient):
mock_volumes = mock.MagicMock()
mock_cinderclient.return_value = mock.MagicMock(version='1',
volumes=mock_volumes)
self.api.detach(self.ctx, 'id1', instance_uuid='fake_uuid')
mock_cinderclient.assert_called_with(self.ctx)
mock_volumes.detach.assert_called_once_with('id1')
@mock.patch('nova.volume.cinder.cinderclient')
def test_detach(self, mock_cinderclient):
mock_volumes = mock.MagicMock()

View File

@ -319,10 +319,6 @@ class API(object):
def detach(self, context, volume_id, instance_uuid=None,
attachment_id=None):
client = cinderclient(context)
if client.version == '1':
client.volumes.detach(volume_id)
return
if attachment_id is None:
volume = self.get(context, volume_id)
if volume['multiattach']: