From 0bc4bb4fbc7f5a04732c8fe19a89e0e2d329f0f5 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Wed, 6 Apr 2016 20:40:31 -0500 Subject: [PATCH] Remove deprecated ISERTgtAdm ISERTgtAdm was deprecated in the Kilo release. It should now be removed. Change-Id: I143b7b2fe9f5eb254d9e6b7ce35824d1ba97d457 --- cinder/tests/unit/targets/test_iser_driver.py | 26 ----------- cinder/volume/driver.py | 11 ++--- cinder/volume/targets/iser.py | 46 ------------------- .../removed-isertgtadm-7ccefab5d3e89c59.yaml | 8 ++++ 4 files changed, 13 insertions(+), 78 deletions(-) delete mode 100644 cinder/volume/targets/iser.py create mode 100644 releasenotes/notes/removed-isertgtadm-7ccefab5d3e89c59.yaml diff --git a/cinder/tests/unit/targets/test_iser_driver.py b/cinder/tests/unit/targets/test_iser_driver.py index 85bebb07e..82e36106c 100644 --- a/cinder/tests/unit/targets/test_iser_driver.py +++ b/cinder/tests/unit/targets/test_iser_driver.py @@ -14,36 +14,10 @@ import mock from cinder.tests.unit.targets import targets_fixture as tf from cinder import utils -from cinder.volume.targets import iser from cinder.volume.targets import lio from cinder.volume.targets import tgt -class TestIserAdmDriver(tf.TargetDriverFixture): - """Unit tests for the deprecated ISERTgtAdm flow""" - - def setUp(self): - super(TestIserAdmDriver, self).setUp() - self.target = iser.ISERTgtAdm(root_helper=utils.get_root_helper(), - configuration=self.configuration) - - @mock.patch.object(iser.ISERTgtAdm, '_get_iscsi_properties') - def test_initialize_connection(self, mock_get_iscsi): - - connector = {'initiator': 'fake_init'} - - # Test the normal case - mock_get_iscsi.return_value = {} - expected_return = {'driver_volume_type': 'iser', - 'data': {}} - self.assertEqual(expected_return, - self.target.initialize_connection(self.testvol, - connector)) - - def test_iscsi_protocol(self): - self.assertEqual('iser', self.target.iscsi_protocol) - - class TestIserTgtDriver(tf.TargetDriverFixture): """Unit tests for the iSER TGT flow""" diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 0171195ff..d7ab1c472 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -88,12 +88,12 @@ volume_opts = [ 'for example "-c3" for idle only priority.'), cfg.StrOpt('iscsi_helper', default='tgtadm', - choices=['tgtadm', 'lioadm', 'scstadmin', 'iseradm', 'iscsictl', + choices=['tgtadm', 'lioadm', 'scstadmin', 'iscsictl', 'ietadm', 'fake'], help='iSCSI target user-land tool to use. tgtadm is default, ' 'use lioadm for LIO iSCSI support, scstadmin for SCST ' - 'target support, iseradm for the ISER protocol, ietadm ' - 'for iSCSI Enterprise Target, iscsictl for Chelsio iSCSI ' + 'target support, ietadm for iSCSI Enterprise Target, ' + 'iscsictl for Chelsio iSCSI ' 'Target or fake for testing.'), cfg.StrOpt('volumes_dir', default='$state_path/volumes', @@ -130,7 +130,7 @@ volume_opts = [ help='Sets the behavior of the iSCSI target to either ' 'perform write-back(on) or write-through(off). ' 'This parameter is valid if iscsi_helper is set ' - 'to tgtadm or iseradm.'), + 'to tgtadm.'), cfg.StrOpt('iscsi_target_flags', default='', help='Sets the target-specific flags for the iSCSI target. ' @@ -329,7 +329,6 @@ class BaseVD(object): self.target_mapping = { 'fake': 'cinder.volume.targets.fake.FakeTarget', 'ietadm': 'cinder.volume.targets.iet.IetAdm', - 'iseradm': 'cinder.volume.targets.iser.ISERTgtAdm', 'lioadm': 'cinder.volume.targets.lio.LioAdm', 'tgtadm': 'cinder.volume.targets.tgt.TgtAdm', 'scstadmin': 'cinder.volume.targets.scst.SCSTAdm', @@ -2414,7 +2413,7 @@ class ISCSIDriver(VolumeDriver): except (IndexError, ValueError): if (self.configuration.volume_driver == 'cinder.volume.drivers.lvm.ThinLVMVolumeDriver' and - self.configuration.iscsi_helper in ('tgtadm', 'iseradm')): + self.configuration.iscsi_helper == 'tgtadm'): lun = 1 else: lun = 0 diff --git a/cinder/volume/targets/iser.py b/cinder/volume/targets/iser.py deleted file mode 100644 index 4b393248f..000000000 --- a/cinder/volume/targets/iser.py +++ /dev/null @@ -1,46 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from oslo_log import log as logging - -from cinder.i18n import _LW -from cinder.volume.targets import tgt - - -LOG = logging.getLogger(__name__) - - -class ISERTgtAdm(tgt.TgtAdm): - VERSION = '0.2' - - def __init__(self, *args, **kwargs): - super(ISERTgtAdm, self).__init__(*args, **kwargs) - - LOG.warning(_LW('ISERTgtAdm is deprecated, you should ' - 'now just use LVMVolumeDriver and specify ' - 'iscsi_helper for the target driver you ' - 'wish to use. In order to enable iser, please ' - 'set iscsi_protocol=iser with lioadm or tgtadm ' - 'target helpers.')) - - self.volumes_dir = self.configuration.safe_get('volumes_dir') - self.iscsi_protocol = 'iser' - self.protocol = 'iSER' - - # backwards compatibility mess - self.configuration.num_volume_device_scan_tries = \ - self.configuration.num_iser_scan_tries - self.configuration.iscsi_target_prefix = \ - self.configuration.iser_target_prefix - self.configuration.iscsi_ip_address = \ - self.configuration.iser_ip_address - self.configuration.iscsi_port = self.configuration.iser_port diff --git a/releasenotes/notes/removed-isertgtadm-7ccefab5d3e89c59.yaml b/releasenotes/notes/removed-isertgtadm-7ccefab5d3e89c59.yaml new file mode 100644 index 000000000..4acf016fb --- /dev/null +++ b/releasenotes/notes/removed-isertgtadm-7ccefab5d3e89c59.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - The ISERTgtAdm target was deprecated in the Kilo release. + It has now been removed. You should now just use + LVMVolumeDriver and specify iscsi_helper for the target + driver you wish to use. In order to enable iser, please + set iscsi_protocol=iser with lioadm or tgtadm target + helpers.