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
1=== modified file 'nova/tests/test_libvirt.py'
2--- nova/tests/test_libvirt.py 2011-09-09 09:24:28 +0000
3+++ nova/tests/test_libvirt.py 2011-09-13 12:48:38 +0000
4@@ -743,7 +743,7 @@
5 # qemu-img should be mockd since test environment might not have
6 # large disk space.
7 self.mox.StubOutWithMock(utils, "execute")
8- utils.execute('sudo', 'qemu-img', 'create', '-f', 'raw',
9+ utils.execute('qemu-img', 'create', '-f', 'raw',
10 '%s/%s/disk' % (tmpdir, instance_ref.name), '10G')
11
12 self.mox.ReplayAll()
13@@ -795,7 +795,7 @@
14 os.path.getsize("/test/disk").AndReturn(10 * 1024 * 1024 * 1024)
15 # another is qcow image, so qemu-img should be mocked.
16 self.mox.StubOutWithMock(utils, "execute")
17- utils.execute('sudo', 'qemu-img', 'info', '/test/disk.local').\
18+ utils.execute('qemu-img', 'info', '/test/disk.local').\
19 AndReturn((ret, ''))
20
21 self.mox.ReplayAll()
22
23=== modified file 'nova/virt/disk.py'
24--- nova/virt/disk.py 2011-09-12 14:19:19 +0000
25+++ nova/virt/disk.py 2011-09-13 12:48:38 +0000
26@@ -229,8 +229,8 @@
27 metadata_path = os.path.join(fs, "meta.js")
28 metadata = dict([(m.key, m.value) for m in metadata])
29
30- utils.execute('sudo', 'tee', metadata_path,
31- process_input=json.dumps(metadata))
32+ utils.execute('tee', metadata_path,
33+ process_input=json.dumps(metadata), run_as_root=True)
34
35
36 def _inject_key_into_fs(key, fs, execute=None):

Subscribers

People subscribed via source and target branches