From: Eric Harney Date: Thu, 9 Oct 2014 20:26:18 +0000 (-0400) Subject: Remove lio_initiator_iqns X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6a8803f27b11da7b54d62f3e0b08c58b6bd685ce;p=openstack-build%2Fcinder-build.git Remove lio_initiator_iqns This is a holdover from the initial LIO implementation which did not manage ACLs sufficiently. This is unneeded now and handled by: 67dd248 LIO iSCSI initiator ACL auto-config DocImpact: remove lio_initiator_iqns cfg opt Closes-Bug: #1390383 Change-Id: I3b7fe4765c1c568a6a7713f86cadece52b130911 --- diff --git a/cinder/brick/iscsi/iscsi.py b/cinder/brick/iscsi/iscsi.py index a106b8f83..1ccdf4711 100644 --- a/cinder/brick/iscsi/iscsi.py +++ b/cinder/brick/iscsi/iscsi.py @@ -508,13 +508,12 @@ class FakeIscsiHelper(object): class LioAdm(TargetAdmin): """iSCSI target administration for LIO using python-rtslib.""" - def __init__(self, root_helper, lio_initiator_iqns='', + def __init__(self, root_helper, iscsi_target_prefix='iqn.2010-10.org.openstack:', execute=putils.execute): super(LioAdm, self).__init__('cinder-rtstool', root_helper, execute) self.iscsi_target_prefix = iscsi_target_prefix - self.lio_initiator_iqns = lio_initiator_iqns self._verify_rtstool() def _verify_rtstool(self): @@ -546,18 +545,12 @@ class LioAdm(TargetAdmin): if chap_auth is not None: (chap_auth_userid, chap_auth_password) = chap_auth.split(' ')[1:] - extra_args = [] - if self.lio_initiator_iqns: - extra_args.append(self.lio_initiator_iqns) - try: command_args = ['create', path, name, chap_auth_userid, chap_auth_password] - if extra_args: - command_args.extend(extra_args) self._run('cinder-rtstool', *command_args, run_as_root=True) except putils.ProcessExecutionError as e: LOG.error(_LE("Failed to create iscsi target for volume " diff --git a/cinder/tests/conf_fixture.py b/cinder/tests/conf_fixture.py index 00153de5c..4bb29c998 100644 --- a/cinder/tests/conf_fixture.py +++ b/cinder/tests/conf_fixture.py @@ -38,7 +38,6 @@ def set_defaults(conf): conf.set_default('volume_driver', 'cinder.tests.fake_driver.FakeISCSIDriver') conf.set_default('iscsi_helper', 'fake') - conf.set_default('fake_rabbit', True) conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake') conf.set_default('iscsi_num_targets', 8) conf.set_default('connection', 'sqlite://', group='database') diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index d7ea62a8b..db7d39d18 100755 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -92,9 +92,8 @@ volume_opts = [ help='IET configuration file'), cfg.StrOpt('lio_initiator_iqns', default='', - help=('Comma-separated list of initiator IQNs ' - 'allowed to connect to the ' - 'iSCSI target. (From Nova compute nodes.)')), + help='This option is deprecated and unused. ' + 'It will be removed in the next release.'), cfg.StrOpt('iscsi_iotype', default='fileio', help=('Sets the behavior of the iSCSI target ' @@ -1122,9 +1121,7 @@ class ISCSIDriver(VolumeDriver): elif CONF.iscsi_helper == 'fake': return iscsi.FakeIscsiHelper() elif CONF.iscsi_helper == 'lioadm': - return iscsi.LioAdm(root_helper, - CONF.lio_initiator_iqns, - CONF.iscsi_target_prefix, db=db) + return iscsi.LioAdm(root_helper, CONF.iscsi_target_prefix, db=db) else: return iscsi.IetAdm(root_helper, CONF.iet_conf, CONF.iscsi_iotype, db=db) diff --git a/cinder/volume/targets/lio.py b/cinder/volume/targets/lio.py index 905edac1b..f25d528af 100644 --- a/cinder/volume/targets/lio.py +++ b/cinder/volume/targets/lio.py @@ -13,7 +13,7 @@ from oslo.concurrency import processutils as putils from cinder import exception -from cinder.i18n import _, _LI, _LE +from cinder.i18n import _, _LE, _LI, _LW from cinder.openstack.common import log as logging from cinder.volume.targets.tgt import TgtAdm @@ -30,6 +30,11 @@ class LioAdm(TgtAdm): self.configuration.safe_get('iscsi_target_prefix') self.lio_initiator_iqns =\ self.configuration.safe_get('lio_initiator_iqns') + + if self.lio_initiator_iqns is not None: + LOG.warning(_LW("The lio_initiator_iqns option has been " + "deprecated and no longer has any effect.")) + self._verify_rtstool() def remove_export(self, context, volume): @@ -93,10 +98,6 @@ class LioAdm(TgtAdm): if chap_auth is not None: (chap_auth_userid, chap_auth_password) = chap_auth.split(' ')[1:] - extra_args = [] - if self.lio_initiator_iqns: - extra_args.append(self.lio_initiator_iqns) - try: command_args = ['cinder-rtstool', 'create', @@ -104,8 +105,6 @@ class LioAdm(TgtAdm): name, chap_auth_userid, chap_auth_password] - if extra_args: - command_args.extend(extra_args) self._execute(*command_args, run_as_root=True) except putils.ProcessExecutionError as e: LOG.error(_LE("Failed to create iscsi target for volume " diff --git a/etc/cinder/cinder.conf.sample b/etc/cinder/cinder.conf.sample index e5027cd3b..83b3b69fc 100644 --- a/etc/cinder/cinder.conf.sample +++ b/etc/cinder/cinder.conf.sample @@ -1075,8 +1075,8 @@ # IET configuration file (string value) #iet_conf=/etc/iet/ietd.conf -# Comma-separated list of initiator IQNs allowed to connect to -# the iSCSI target. (From Nova compute nodes.) (string value) +# This option is deprecated and unused. It will be removed in +# the next release. (string value) #lio_initiator_iqns= # Sets the behavior of the iSCSI target to either perform