From 499f36869cd081e383cb0ca82a3f656b296f6343 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanino Date: Fri, 23 Jan 2015 17:06:12 -0500 Subject: [PATCH] Remove unnecessary method: _ensure_iscsi_targets() in tgt.py This method is unnecessary in tgt.py after Target Object is introduced at change-id I43190d1dac33748fe55fa00f260f32ab209be656. Change-Id: I33a56db72535c7ea9bf6ddf43fbdd6eff923c9f3 --- cinder/volume/targets/tgt.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/cinder/volume/targets/tgt.py b/cinder/volume/targets/tgt.py index b2a9ce30d..fcc9a664b 100644 --- a/cinder/volume/targets/tgt.py +++ b/cinder/volume/targets/tgt.py @@ -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] -- 2.45.2