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

Proposed by Thierry Carrez
Status: Merged
Approved by: Dan Prince
Approved revision: 1542
Merged at revision: 1554
Proposed branch: lp:~ttx/nova/lp847768
Merge into: lp:~hudson-openstack/nova/trunk
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
Dan Prince (community) Approve
Brian Waldon (community) Approve
Review via email: mp+74987@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.
Revision history for this message
Brian Waldon (bcwaldon) wrote :

Looks good.

review: Approve
Revision history for this message
Dan Prince (dan-prince) wrote :

Looks good.

review: Approve

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-07 16:12:23 +0000
3+++ nova/tests/test_libvirt.py 2011-09-12 12:54:31 +0000
4@@ -700,7 +700,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@@ -752,7 +752,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-02 20:30:52 +0000
25+++ nova/virt/disk.py 2011-09-12 12:54:31 +0000
26@@ -228,8 +228,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):