From b46f224f7555e3065b0daacd101b65d86117f0c1 Mon Sep 17 00:00:00 2001 From: MotoKen Date: Wed, 29 Aug 2012 14:34:18 +0800 Subject: [PATCH] Correct IetAdm remove_iscsi_target Remove logical units should be done before delete the target while unexport iSCSI volume. Or ietd will show "No such file or directory" error. Fix bug 1043107 Change-Id: I06ac561898dbcee078c807ea5368c03e558b4fa9 --- nova/tests/test_iscsi.py | 4 ++-- nova/volume/iscsi.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nova/tests/test_iscsi.py b/nova/tests/test_iscsi.py index d1a666ab8e52..7b2506a87df8 100644 --- a/nova/tests/test_iscsi.py +++ b/nova/tests/test_iscsi.py @@ -118,5 +118,5 @@ class IetAdmTestCase(test.TestCase, TargetAdminTestCase): 'ietadm --op new --tid=%(tid)s --lun=%(lun)s ' '--params Path=%(path)s,Type=fileio', 'ietadm --op show --tid=%(tid)s', - 'ietadm --op delete --tid=%(tid)s', - 'ietadm --op delete --tid=%(tid)s --lun=%(lun)s']) + 'ietadm --op delete --tid=%(tid)s --lun=%(lun)s', + 'ietadm --op delete --tid=%(tid)s']) diff --git a/nova/volume/iscsi.py b/nova/volume/iscsi.py index 48e088e05d42..8742c1de3369 100644 --- a/nova/volume/iscsi.py +++ b/nova/volume/iscsi.py @@ -193,8 +193,8 @@ class IetAdm(TargetAdmin): def remove_iscsi_target(self, tid, lun, vol_id, **kwargs): LOG.info(_('Removing volume: %s') % vol_id) - self._delete_target(tid, **kwargs) self._delete_logicalunit(tid, lun, **kwargs) + self._delete_target(tid, **kwargs) def _new_target(self, name, tid, **kwargs): self._run('--op', 'new',