]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove unnecessary method: _ensure_iscsi_targets() in tgt.py
authorMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Fri, 23 Jan 2015 22:06:12 +0000 (17:06 -0500)
committerMitsuhiro Tanino <mitsuhiro.tanino@hds.com>
Fri, 23 Jan 2015 23:17:18 +0000 (18:17 -0500)
This method is unnecessary in tgt.py after Target Object is
introduced at change-id I43190d1dac33748fe55fa00f260f32ab209be656.

Change-Id: I33a56db72535c7ea9bf6ddf43fbdd6eff923c9f3

cinder/volume/targets/tgt.py

index b2a9ce30d625cbd5248b533fec4544a54290f017..fcc9a664b603f687a7d54740ffb7455a9730f7c8 100644 (file)
@@ -125,22 +125,6 @@ class TgtAdm(iscsi.ISCSITarget):
         iscsi_target = 0  # NOTE(jdg): Not used by tgtadm
         return iscsi_target, lun
 
-    def _ensure_iscsi_targets(self, context, host):
-        """Ensure that target ids have been created in datastore."""
-        # NOTE(jdg): tgtadm doesn't use the iscsi_targets table
-        # TODO(jdg): In the future move all of the dependent stuff into the
-        # cooresponding target admin class
-        host_iscsi_targets = self.db.iscsi_target_count_by_host(context,
-                                                                host)
-        if host_iscsi_targets >= self.configuration.iscsi_num_targets:
-            return
-
-        # NOTE(vish): Target ids start at 1, not 0.
-        target_end = self.configuration.iscsi_num_targets + 1
-        for target_num in xrange(1, target_end):
-            target = {'host': host, 'target_num': target_num}
-            self.db.iscsi_target_create_safe(context, target)
-
     def _get_target_chap_auth(self, name):
         volumes_dir = self.volumes_dir
         vol_id = name.split(':')[1]