From b87d7f4a7bab7061fbcaa9d6516a3cbf74518e48 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Mon, 20 Feb 2017 14:11:59 -0500 Subject: [PATCH] Remove a dead cinder v1 check We removed support for cinder v1 in change 84f5c6165bc94690d299ed4d025e421a651d1bb5 but missed this condition. Change-Id: I610c9dcf73354d7b78958cf2a1b8dba088896c4d --- nova/tests/unit/volume/test_cinder.py | 11 ----------- nova/volume/cinder.py | 4 ---- 2 files changed, 15 deletions(-) diff --git a/nova/tests/unit/volume/test_cinder.py b/nova/tests/unit/volume/test_cinder.py index 7b325a3a60c4..904d1d04b494 100644 --- a/nova/tests/unit/volume/test_cinder.py +++ b/nova/tests/unit/volume/test_cinder.py @@ -307,17 +307,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() diff --git a/nova/volume/cinder.py b/nova/volume/cinder.py index 019956275856..2f133f237465 100644 --- a/nova/volume/cinder.py +++ b/nova/volume/cinder.py @@ -327,10 +327,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']: