]> 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 19:50:55 +0000 (12:50 -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

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

index 7b1a327d47bcee4197c3e090d3a6739bb95c81f0..b5ea8e49f85168fbbcb12b0318b8210f90cb0a96 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 77efed4701e73b406e3513a55ab05aa190e0a47f..6fde9d96347390a06d81f2f9ab635930a31b59d8 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)