]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
LIO: Don't add ACL for local initiator name
authorEric Harney <eharney@redhat.com>
Tue, 10 Jun 2014 15:25:01 +0000 (11:25 -0400)
committerEric Harney <eharney@redhat.com>
Tue, 10 Jun 2014 15:40:35 +0000 (11:40 -0400)
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

index 07fe5947d9ca9e31fefef2bec6be5fd7c91c34f4..410524345ea18a2bcc6b84bba56d2a06f4d4a124 100755 (executable)
@@ -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(','):