]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix LVM iSCSI driver tgtadm CHAP authentication
authorTomoki Sekiyama <tomoki.sekiyama@hds.com>
Tue, 14 Oct 2014 23:09:44 +0000 (19:09 -0400)
committerjohn-griffith <john.griffith@solidfire.com>
Wed, 15 Oct 2014 03:50:15 +0000 (21:50 -0600)
Currently CHAP Authentication in LVM iSCSI driver with tgtadm does not work.
This is because the tgtadm helper creates the target configuration file
with an 'IncomingUser' entry, which is ignored by tgtd.
This patch fixes it to 'incominguser'.

Change-Id: I14871985a2a916834122f849238f05b75726bc1a
Closes-Bug: #1329214
(cherry picked from commit e3563891545c801726d227f752cf99488ed5c7dd)

cinder/brick/iscsi/iscsi.py

index f557e61724f3cfb581cfe5fb6e0c2e1568895570..e94a3438e594879042d52043a9d2726459e081af 100644 (file)
@@ -171,8 +171,9 @@ class TgtAdm(TargetAdmin):
         if chap_auth is None:
             volume_conf = self.VOLUME_CONF % (name, path, write_cache)
         else:
+            chap_str = re.sub('^IncomingUser ', 'incominguser ', chap_auth)
             volume_conf = self.VOLUME_CONF_WITH_CHAP_AUTH % (name,
-                                                             path, chap_auth,
+                                                             path, chap_str,
                                                              write_cache)
 
         LOG.info(_('Creating iscsi_target for: %s') % vol_id)