diff options
| author | Chuck Short <chuck.short@canonical.com> | 2012-07-30 11:45:09 -0500 |
|---|---|---|
| committer | Chuck Short <chuck.short@canonical.com> | 2012-07-30 11:46:12 -0500 |
| commit | e24e3510d442e4616ef570dc108b6d537777a8d8 (patch) | |
| tree | 98f03f04a0ccbedca800261765a260d2b4eb7cfd | |
| parent | 8f0d8e26d09ff6de3065864d6d62d124bcc85737 (diff) | |
Fix rootwrapper with tgt-admin
Dont use the full path when calling tgt-admin.
LP: #1030850
Change-Id: Ifc7a1960aa67325e9219309e06de292010d7ec46
Signed-off-by: Chuck Short <chuck.short@canonical.com>
| -rw-r--r-- | nova/tests/test_iscsi.py | 4 | ||||
| -rw-r--r-- | 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: |
