From 37472be084358717ec2a046147e42dc248258ee9 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Tue, 10 Jun 2014 11:25:01 -0400 Subject: [PATCH] LIO: Don't add ACL for local initiator name Currently cinder-rtstool requires /etc/iscsi/initiatorname.iscsi to be present in order to create a LUN/ACL/portal successfully. However, this is not required since Cinder will create the required ACLs dynamically at attach time as well. Removing this path means that iscsi-initiator-utils no longer needs to be installed locally when using a remote Nova compute node. Closes-Bug: 1328580 Change-Id: Ieb5e28e3f81987ab8518b861fff885f371969a56 --- bin/cinder-rtstool | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/bin/cinder-rtstool b/bin/cinder-rtstool index 07fe5947d..410524345 100755 --- a/bin/cinder-rtstool +++ b/bin/cinder-rtstool @@ -17,7 +17,6 @@ # limitations under the License. import gettext -import re import sys import rtslib @@ -56,30 +55,6 @@ def create(backing_device, name, userid, password, initiator_iqns=None): lun_new = rtslib.LUN(tpg_new, storage_object=so_new) - initiator_name = None - name_file = '/etc/iscsi/initiatorname.iscsi' - - try: - with open(name_file, 'r') as f: - for line in f: - m = re.match('InitiatorName=(.+)', line) - if m != None: - initiator_name = m.group(1) - break - except IOError: - raise RtstoolError(_('Could not open %s') % name_file) - - if initiator_name == None: - raise RtstoolError(_('Could not read InitiatorName from %s') % - name_file) - - acl_new = rtslib.NodeACL(tpg_new, initiator_name, mode='create') - - acl_new.chap_userid = userid - acl_new.chap_password = password - - rtslib.MappedLUN(acl_new, lun_new.lun, lun_new.lun) - if initiator_iqns: initiator_iqns = initiator_iqns.strip(' ') for i in initiator_iqns.split(','): -- 2.45.2