]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Force deletes using tgt to workaround bug 1159948
authorVishvananda Ishaya <vishvananda@gmail.com>
Mon, 25 Mar 2013 19:46:51 +0000 (12:46 -0700)
committerVishvananda Ishaya <vishvananda@gmail.com>
Mon, 25 Mar 2013 20:06:43 +0000 (13:06 -0700)
Tgt has a bug where it can have multiple copies of an initiator
if there has been a reconnect.

See https://bugs.launchpad.net/cinder/+bug/1159948

Change-Id: I9a1b6757eb780efbaa1403016e50de7c0e45d720
(cherry picked from commit b84218633ab5417adf94c568eb54243f4074ab11)

cinder/tests/test_iscsi.py
cinder/volume/iscsi.py

index 4bd942852352c51192fff8f1153a9413964d57d5..15bc7cc637fc33858073a388f18a5e03b7f8c51c 100644 (file)
@@ -101,7 +101,8 @@ class TgtAdmTestCase(test.TestCase, TargetAdminTestCase):
         self.flags(volumes_dir=self.persist_tempdir)
         self.script_template = "\n".join([
             'tgt-admin --update iqn.2011-09.org.foo.bar:blaa',
-            'tgt-admin --delete iqn.2010-10.org.openstack:volume-blaa'])
+            'tgt-admin --force '
+            '--delete iqn.2010-10.org.openstack:volume-blaa'])
 
     def tearDown(self):
         try:
index ae664b767b4399adec7ce672c8d03c81b06d47b9..d231de8f65297034f0585911d7cdcddd4e1f67a7 100644 (file)
@@ -190,7 +190,10 @@ class TgtAdm(TargetAdmin):
         else:
             raise exception.ISCSITargetRemoveFailed(volume_id=vol_id)
         try:
+            # NOTE(vish): --force is a workaround for bug:
+            #             https://bugs.launchpad.net/cinder/+bug/1159948
             self._execute('tgt-admin',
+                          '--force',
                           '--delete',
                           iqn,
                           run_as_root=True)