Merge lp:~ttx/nova/lp847768 into lp:~hudson-openstack/nova/milestone-proposed

Proposed by Thierry Carrez
Status: Merged
Approved by: Vish Ishaya
Approved revision: 1542
Merged at revision: 1167
Proposed branch: lp:~ttx/nova/lp847768
Merge into: lp:~hudson-openstack/nova/milestone-proposed
Diff against target: 36 lines (+4/-4)
2 files modified
nova/tests/test_libvirt.py (+2/-2)
nova/virt/disk.py (+2/-2)
To merge this branch: bzr merge lp:~ttx/nova/lp847768
Reviewer Review Type Date Requested Status
OpenStack release team Pending
Review via email: mp+75166@code.launchpad.net

Commit message

Fixes rogue usage of sudo that crept in

Description of the change

Fixes rogue usage of sudo that crept in since all sudo calls were abstracted using run_as_root=True (and the root_helper flag).

The one in tests was actually fixed to match what Vish pushed in rev1546 (those don't use sudo anymore).

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'nova/tests/test_libvirt.py'
--- nova/tests/test_libvirt.py 2011-09-09 09:24:28 +0000
+++ nova/tests/test_libvirt.py 2011-09-13 12:48:38 +0000
@@ -743,7 +743,7 @@
743 # qemu-img should be mockd since test environment might not have743 # qemu-img should be mockd since test environment might not have
744 # large disk space.744 # large disk space.
745 self.mox.StubOutWithMock(utils, "execute")745 self.mox.StubOutWithMock(utils, "execute")
746 utils.execute('sudo', 'qemu-img', 'create', '-f', 'raw',746 utils.execute('qemu-img', 'create', '-f', 'raw',
747 '%s/%s/disk' % (tmpdir, instance_ref.name), '10G')747 '%s/%s/disk' % (tmpdir, instance_ref.name), '10G')
748748
749 self.mox.ReplayAll()749 self.mox.ReplayAll()
@@ -795,7 +795,7 @@
795 os.path.getsize("/test/disk").AndReturn(10 * 1024 * 1024 * 1024)795 os.path.getsize("/test/disk").AndReturn(10 * 1024 * 1024 * 1024)
796 # another is qcow image, so qemu-img should be mocked.796 # another is qcow image, so qemu-img should be mocked.
797 self.mox.StubOutWithMock(utils, "execute")797 self.mox.StubOutWithMock(utils, "execute")
798 utils.execute('sudo', 'qemu-img', 'info', '/test/disk.local').\798 utils.execute('qemu-img', 'info', '/test/disk.local').\
799 AndReturn((ret, ''))799 AndReturn((ret, ''))
800800
801 self.mox.ReplayAll()801 self.mox.ReplayAll()
802802
=== modified file 'nova/virt/disk.py'
--- nova/virt/disk.py 2011-09-12 14:19:19 +0000
+++ nova/virt/disk.py 2011-09-13 12:48:38 +0000
@@ -229,8 +229,8 @@
229 metadata_path = os.path.join(fs, "meta.js")229 metadata_path = os.path.join(fs, "meta.js")
230 metadata = dict([(m.key, m.value) for m in metadata])230 metadata = dict([(m.key, m.value) for m in metadata])
231231
232 utils.execute('sudo', 'tee', metadata_path,232 utils.execute('tee', metadata_path,
233 process_input=json.dumps(metadata))233 process_input=json.dumps(metadata), run_as_root=True)
234234
235235
236def _inject_key_into_fs(key, fs, execute=None):236def _inject_key_into_fs(key, fs, execute=None):

Subscribers

People subscribed via source and target branches