From e24e3510d442e4616ef570dc108b6d537777a8d8 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Mon, 30 Jul 2012 11:45:09 -0500 Subject: Fix rootwrapper with tgt-admin Dont use the full path when calling tgt-admin. LP: #1030850 Change-Id: Ifc7a1960aa67325e9219309e06de292010d7ec46 Signed-off-by: Chuck Short --- nova/tests/test_iscsi.py | 4 ++-- nova/volume/iscsi.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nova/tests/test_iscsi.py b/nova/tests/test_iscsi.py index df619f28c..4ea4deda9 100644 --- a/nova/tests/test_iscsi.py +++ b/nova/tests/test_iscsi.py @@ -85,9 +85,9 @@ class TgtAdmTestCase(test.TestCase, TargetAdminTestCase): self.flags(iscsi_helper='tgtadm') self.flags(volumes_dir="./") self.script_template = "\n".join([ - "/usr/sbin/tgt-admin --conf ./blaa --update blaa", + "tgt-admin --conf ./blaa --update blaa", "tgtadm --op show --lld=iscsi --mode=target --tid=1", - "/usr/bin/tgt-admin --conf ./blaa --delete blaa"]) + "tgt-admin --conf ./blaa --delete blaa"]) class IetAdmTestCase(test.TestCase, TargetAdminTestCase): diff --git a/nova/volume/iscsi.py b/nova/volume/iscsi.py index b565430d7..b846edd8d 100644 --- a/nova/volume/iscsi.py +++ b/nova/volume/iscsi.py @@ -115,7 +115,7 @@ class TgtAdm(TargetAdmin): f.write(volume_conf) f.close() - self._execute('/usr/sbin/tgt-admin', '--conf %s' % volume_path, + self._execute('tgt-admin', '--conf %s' % volume_path, '--update %s' % vol_id, run_as_root=True) except Exception as ex: @@ -128,7 +128,7 @@ class TgtAdm(TargetAdmin): LOG.info(_('Removing volume: %s') % vol_id) volume_path = os.path.join(FLAGS.volumes_dir, vol_id) if os.path.isfile(volume_path): - self._execute('/usr/bin/tgt-admin', '--conf %s' % volume_path, + self._execute('tgt-admin', '--conf %s' % volume_path, '--delete %s' % vol_id, run_as_root_root=True) os.unlink(volume_path) except Exception as ex: -- cgit