Merge lp:~soren/nova/volume-execvp into lp:~hudson-openstack/nova/trunk

Proposed by Soren Hansen
Status: Merged
Approved by: Soren Hansen
Approved revision: 818
Merged at revision: 823
Proposed branch: lp:~soren/nova/volume-execvp
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 82 lines (+14/-12)
2 files modified
nova/tests/test_volume.py (+5/-4)
nova/volume/driver.py (+9/-8)
To merge this branch: bzr merge lp:~soren/nova/volume-execvp
Reviewer Review Type Date Requested Status
Rick Harris (community) Approve
Devin Carlen (community) Approve
Review via email: mp+53795@code.launchpad.net

Commit message

Fix a number of place in the volume driver where the argv hadn't been fully split

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Rick Harris (rconradharris) wrote :

Some tests failed for me: http://paste.openstack.org/show/920/

review: Needs Fixing
Revision history for this message
Soren Hansen (soren) wrote :

2011/3/17 Rick Harris <email address hidden>:
> Review: Needs Fixing
> Some tests failed for me: http://paste.openstack.org/show/920/

Gah, yes. I only ran my integration tests. Sorry :(

--
Soren Hansen        | http://linux2go.dk/
Ubuntu Developer    | http://www.ubuntu.com/
OpenStack Developer | http://www.openstack.org/

Revision history for this message
Rick Harris (rconradharris) wrote :

More pep-8 shenanigans: http://paste.openstack.org/show/923/

review: Needs Fixing
Revision history for this message
Soren Hansen (soren) wrote :

2011/3/17 Rick Harris <email address hidden>:
> Review: Needs Fixing
> More pep-8 shenanigans: http://paste.openstack.org/show/923/

What, seriously?

Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm, thanks for the fixes.

review: Approve
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
Soren Hansen (soren) wrote :

> There are additional revisions which have not been approved in review. Please
> seek review and approval of these new revisions.

Uh... No, there isn't.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/tests/test_volume.py'
2--- nova/tests/test_volume.py 2011-03-10 06:23:13 +0000
3+++ nova/tests/test_volume.py 2011-03-17 21:23:47 +0000
4@@ -336,8 +336,8 @@
5 self.mox.StubOutWithMock(self.volume.driver, '_execute')
6 for i in volume_id_list:
7 tid = db.volume_get_iscsi_target_num(self.context, i)
8- self.volume.driver._execute("sudo ietadm --op show --tid=%(tid)d"
9- % locals())
10+ self.volume.driver._execute("sudo", "ietadm", "--op", "show",
11+ "--tid=%(tid)d" % locals())
12
13 self.stream.truncate(0)
14 self.mox.ReplayAll()
15@@ -355,8 +355,9 @@
16 # the first vblade process isn't running
17 tid = db.volume_get_iscsi_target_num(self.context, volume_id_list[0])
18 self.mox.StubOutWithMock(self.volume.driver, '_execute')
19- self.volume.driver._execute("sudo ietadm --op show --tid=%(tid)d"
20- % locals()).AndRaise(exception.ProcessExecutionError())
21+ self.volume.driver._execute("sudo", "ietadm", "--op", "show",
22+ "--tid=%(tid)d" % locals()
23+ ).AndRaise(exception.ProcessExecutionError())
24
25 self.mox.ReplayAll()
26 self.assertRaises(exception.ProcessExecutionError,
27
28=== modified file 'nova/volume/driver.py'
29--- nova/volume/driver.py 2011-03-10 06:23:13 +0000
30+++ nova/volume/driver.py 2011-03-17 21:23:47 +0000
31@@ -207,8 +207,8 @@
32 (shelf_id,
33 blade_id) = self.db.volume_get_shelf_and_blade(context,
34 _volume['id'])
35- self._execute("sudo aoe-discover")
36- out, err = self._execute("sudo aoe-stat", check_exit_code=False)
37+ self._execute('sudo', 'aoe-discover')
38+ out, err = self._execute('sudo', 'aoe-stat', check_exit_code=False)
39 device_path = 'e%(shelf_id)d.%(blade_id)d' % locals()
40 if out.find(device_path) >= 0:
41 return "/dev/etherd/%s" % device_path
42@@ -224,8 +224,8 @@
43 (shelf_id,
44 blade_id) = self.db.volume_get_shelf_and_blade(context,
45 volume_id)
46- cmd = "sudo vblade-persist ls --no-header"
47- out, _err = self._execute(cmd)
48+ cmd = ('sudo', 'vblade-persist', 'ls', '--no-header')
49+ out, _err = self._execute(*cmd)
50 exported = False
51 for line in out.split('\n'):
52 param = line.split(' ')
53@@ -318,8 +318,8 @@
54 iscsi_name = "%s%s" % (FLAGS.iscsi_target_prefix, volume['name'])
55 volume_path = "/dev/%s/%s" % (FLAGS.volume_group, volume['name'])
56 self._execute('sudo', 'ietadm', '--op', 'new',
57- '--tid=%s --params Name=%s' %
58- (iscsi_target, iscsi_name))
59+ '--tid=%s' % iscsi_target,
60+ '--params', 'Name=%s' % iscsi_name)
61 self._execute('sudo', 'ietadm', '--op', 'new',
62 '--tid=%s' % iscsi_target,
63 '--lun=0', '--params',
64@@ -500,7 +500,8 @@
65
66 tid = self.db.volume_get_iscsi_target_num(context, volume_id)
67 try:
68- self._execute("sudo ietadm --op show --tid=%(tid)d" % locals())
69+ self._execute('sudo', 'ietadm', '--op', 'show',
70+ '--tid=%(tid)d' % locals())
71 except exception.ProcessExecutionError, e:
72 # Instances remount read-only in this case.
73 # /etc/init.d/iscsitarget restart and rebooting nova-volume
74@@ -551,7 +552,7 @@
75 def delete_volume(self, volume):
76 """Deletes a logical volume."""
77 self._try_execute('rbd', '--pool', FLAGS.rbd_pool,
78- 'rm', voluname['name'])
79+ 'rm', volume['name'])
80
81 def local_path(self, volume):
82 """Returns the path of the rbd volume."""