]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Obtain target authentication from database same as LIO target"
authorJenkins <jenkins@review.openstack.org>
Thu, 1 Oct 2015 13:39:37 +0000 (13:39 +0000)
committerGerrit Code Review <review@openstack.org>
Thu, 1 Oct 2015 13:39:37 +0000 (13:39 +0000)
1  2 
cinder/tests/unit/test_volume.py
cinder/volume/targets/tgt.py

Simple merge
index 912c1eec3b73f4158b0173738a52891291c72dbb,d1e8169992cd20c6119769c595771a45285f8fc4..ad93713b01ec2a29733375c21c5684b7adbcb477
@@@ -115,40 -114,12 +114,12 @@@ class TgtAdm(iscsi.ISCSITarget)
          iscsi_target = 0  # NOTE(jdg): Not used by tgtadm
          return iscsi_target, lun
  
-     def _get_target_chap_auth(self, context, iscsi_name):
-         """Get the current chap auth username and password."""
-         volumes_dir = self.volumes_dir
-         vol_id = iscsi_name.split(':')[1]
-         volume_path = os.path.join(volumes_dir, vol_id)
-         try:
-             with open(volume_path, 'r') as f:
-                 volume_conf = f.read()
-         except IOError as e_fnf:
-             LOG.debug('Failed to open config for Volume %(vol_id)s: %(e)s',
-                       {'vol_id': vol_id, 'e': e_fnf})
-             # tgt is linux specific
-             if e_fnf.errno == 2:
-                 return None
-             else:
-                 raise
-         except Exception as e_vol:
-             LOG.error(_LE('Failed to open config for %(vol_id)s: %(e)s'),
-                       {'vol_id': vol_id, 'e': e_vol})
-             raise
-         m = re.search('incominguser (\w+) (\w+)', volume_conf)
-         if m:
-             return (m.group(1), m.group(2))
-         LOG.debug('Failed to find CHAP auth from config for %s', vol_id)
-         return None
      @utils.retry(putils.ProcessExecutionError)
      def _do_tgt_update(self, name):
 -            (out, err) = utils.execute('tgt-admin', '--update', name,
 -                                       run_as_root=True)
 -            LOG.debug("StdOut from tgt-admin --update: %s", out)
 -            LOG.debug("StdErr from tgt-admin --update: %s", err)
 +        (out, err) = utils.execute('tgt-admin', '--update', name,
 +                                   run_as_root=True)
 +        LOG.debug("StdOut from tgt-admin --update: %s", out)
 +        LOG.debug("StdErr from tgt-admin --update: %s", err)
  
      def create_iscsi_target(self, name, tid, lun, path,
                              chap_auth=None, **kwargs):