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

Proposed by Soren Hansen
Status: Merged
Approved by: Jay Pipes
Approved revision: 788
Merged at revision: 783
Proposed branch: lp:~soren/nova/execvp-fallout
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 193 lines (+63/-47)
4 files modified
nova/image/s3.py (+19/-12)
nova/network/linux_net.py (+22/-22)
nova/objectstore/image.py (+21/-12)
nova/virt/libvirt_conn.py (+1/-1)
To merge this branch: bzr merge lp:~soren/nova/execvp-fallout
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Review via email: mp+52816@code.launchpad.net

Commit message

Fix a few things that were either missed in the execvp conversion or stuff that was merged after it, but wasn't updated accordingly.

Description of the change

Fix a few things that were either missed in the execvp conversion or stuff that was merged after it, but wasn't updated accordingly.

To post a comment you must log in.
lp:~soren/nova/execvp-fallout updated
786. By Soren Hansen

More execvp fallout

787. By Soren Hansen

Add bugfix metadata.

Revision history for this message
Thierry Carrez (ttx) wrote :

Looks good, could you add this one to the mix ?

--- nova/network/linux_net.py 2011-03-09 20:33:20 +0000
+++ nova/network/linux_net.py 2011-03-10 14:14:07 +0000
@@ -216,7 +216,7 @@
         _execute('sudo', 'brctl', 'setfd', bridge, 0)
         # _execute("sudo brctl setageing %s 10" % bridge)
         _execute('sudo', 'brctl', 'stp', bridge, 'off')
- _execute('sudo', 'ip', 'link', 'set', bridge, up)
+ _execute('sudo', 'ip', 'link', 'set', bridge, 'up')
     if net_attrs:
         # NOTE(vish): The ip for dnsmasq has to be the first address on the
         # bridge for it to respond to reqests properly

lp:~soren/nova/execvp-fallout updated
788. By Soren Hansen

One more thing..

Revision history for this message
Jay Pipes (jaypipes) wrote :

really need functional tests linked to Hudson...

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/image/s3.py'
2--- nova/image/s3.py 2011-03-10 05:02:24 +0000
3+++ nova/image/s3.py 2011-03-10 14:58:44 +0000
4@@ -236,25 +236,32 @@
5 @staticmethod
6 def _decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,
7 cloud_private_key, decrypted_filename):
8- key, err = utils.execute(
9- 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,
10- process_input=encrypted_key,
11- check_exit_code=False)
12+ key, err = utils.execute('openssl',
13+ 'rsautl',
14+ '-decrypt',
15+ '-inkey', '%s' % cloud_private_key,
16+ process_input=encrypted_key,
17+ check_exit_code=False)
18 if err:
19 raise exception.Error(_("Failed to decrypt private key: %s")
20 % err)
21- iv, err = utils.execute(
22- 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,
23- process_input=encrypted_iv,
24- check_exit_code=False)
25+ iv, err = utils.execute('openssl',
26+ 'rsautl',
27+ '-decrypt',
28+ '-inkey', '%s' % cloud_private_key,
29+ process_input=encrypted_iv,
30+ check_exit_code=False)
31 if err:
32 raise exception.Error(_("Failed to decrypt initialization "
33 "vector: %s") % err)
34
35- _out, err = utils.execute(
36- 'openssl enc -d -aes-128-cbc -in %s -K %s -iv %s -out %s'
37- % (encrypted_filename, key, iv, decrypted_filename),
38- check_exit_code=False)
39+ _out, err = utils.execute('openssl', 'enc',
40+ '-d', '-aes-128-cbc',
41+ '-in', '%s' % (encrypted_filename,),
42+ '-K', '%s' % (key,),
43+ '-iv', '%s' % (iv,),
44+ '-out', '%s' % (decrypted_filename,),
45+ check_exit_code=False)
46 if err:
47 raise exception.Error(_("Failed to decrypt image file "
48 "%(image_file)s: %(err)s") %
49
50=== modified file 'nova/network/linux_net.py'
51--- nova/network/linux_net.py 2011-03-09 20:33:20 +0000
52+++ nova/network/linux_net.py 2011-03-10 14:58:44 +0000
53@@ -216,7 +216,7 @@
54 _execute('sudo', 'brctl', 'setfd', bridge, 0)
55 # _execute("sudo brctl setageing %s 10" % bridge)
56 _execute('sudo', 'brctl', 'stp', bridge, 'off')
57- _execute('sudo', 'ip', 'link', 'set', bridge, up)
58+ _execute('sudo', 'ip', 'link', 'set', bridge, 'up')
59 if net_attrs:
60 # NOTE(vish): The ip for dnsmasq has to be the first address on the
61 # bridge for it to respond to reqests properly
62@@ -330,7 +330,7 @@
63 env = {'FLAGFILE': FLAGS.dhcpbridge_flagfile,
64 'DNSMASQ_INTERFACE': network_ref['bridge']}
65 command = _dnsmasq_cmd(network_ref)
66- _execute(command, addl_env=env)
67+ _execute(*command, addl_env=env)
68
69
70 def update_ra(context, network_id):
71@@ -370,7 +370,7 @@
72 else:
73 LOG.debug(_("Pid %d is stale, relaunching radvd"), pid)
74 command = _ra_cmd(network_ref)
75- _execute(command)
76+ _execute(*command)
77 db.network_update(context, network_id,
78 {"ra_server":
79 utils.get_my_linklocal(network_ref['bridge'])})
80@@ -424,30 +424,30 @@
81
82 def _dnsmasq_cmd(net):
83 """Builds dnsmasq command"""
84- cmd = ['sudo -E dnsmasq',
85- ' --strict-order',
86- ' --bind-interfaces',
87- ' --conf-file=',
88- ' --domain=%s' % FLAGS.dhcp_domain,
89- ' --pid-file=%s' % _dhcp_file(net['bridge'], 'pid'),
90- ' --listen-address=%s' % net['gateway'],
91- ' --except-interface=lo',
92- ' --dhcp-range=%s,static,120s' % net['dhcp_start'],
93- ' --dhcp-hostsfile=%s' % _dhcp_file(net['bridge'], 'conf'),
94- ' --dhcp-script=%s' % FLAGS.dhcpbridge,
95- ' --leasefile-ro']
96+ cmd = ['sudo', '-E', 'dnsmasq',
97+ '--strict-order',
98+ '--bind-interfaces',
99+ '--conf-file=',
100+ '--domain=%s' % FLAGS.dhcp_domain,
101+ '--pid-file=%s' % _dhcp_file(net['bridge'], 'pid'),
102+ '--listen-address=%s' % net['gateway'],
103+ '--except-interface=lo',
104+ '--dhcp-range=%s,static,120s' % net['dhcp_start'],
105+ '--dhcp-hostsfile=%s' % _dhcp_file(net['bridge'], 'conf'),
106+ '--dhcp-script=%s' % FLAGS.dhcpbridge,
107+ '--leasefile-ro']
108 if FLAGS.dns_server:
109- cmd.append(' -h -R --server=%s' % FLAGS.dns_server)
110- return ''.join(cmd)
111+ cmd += ['-h', '-R', '--server=%s' % FLAGS.dns_server]
112+ return cmd
113
114
115 def _ra_cmd(net):
116 """Builds radvd command"""
117- cmd = ['sudo -E radvd',
118-# ' -u nobody',
119- ' -C %s' % _ra_file(net['bridge'], 'conf'),
120- ' -p %s' % _ra_file(net['bridge'], 'pid')]
121- return ''.join(cmd)
122+ cmd = ['sudo', '-E', 'radvd',
123+# '-u', 'nobody',
124+ '-C', '%s' % _ra_file(net['bridge'], 'conf'),
125+ '-p', '%s' % _ra_file(net['bridge'], 'pid')]
126+ return cmd
127
128
129 def _stop_dnsmasq(network):
130
131=== modified file 'nova/objectstore/image.py'
132--- nova/objectstore/image.py 2011-03-04 05:04:49 +0000
133+++ nova/objectstore/image.py 2011-03-10 14:58:44 +0000
134@@ -253,25 +253,34 @@
135 @staticmethod
136 def decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,
137 cloud_private_key, decrypted_filename):
138- key, err = utils.execute(
139- 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,
140- process_input=encrypted_key,
141- check_exit_code=False)
142+ key, err = utils.execute('openssl',
143+ 'rsautl',
144+ '-decrypt',
145+ '-inkey', '%s' % cloud_private_key,
146+ process_input=encrypted_key,
147+ check_exit_code=False)
148 if err:
149 raise exception.Error(_("Failed to decrypt private key: %s")
150 % err)
151- iv, err = utils.execute(
152- 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,
153- process_input=encrypted_iv,
154- check_exit_code=False)
155+ iv, err = utils.execute('openssl',
156+ 'rsautl',
157+ '-decrypt',
158+ '-inkey', '%s' % cloud_private_key,
159+ process_input=encrypted_iv,
160+ check_exit_code=False)
161 if err:
162 raise exception.Error(_("Failed to decrypt initialization "
163 "vector: %s") % err)
164
165- _out, err = utils.execute(
166- 'openssl enc -d -aes-128-cbc -in %s -K %s -iv %s -out %s'
167- % (encrypted_filename, key, iv, decrypted_filename),
168- check_exit_code=False)
169+ _out, err = utils.execute('openssl',
170+ 'enc',
171+ '-d',
172+ '-aes-128-cbc',
173+ '-in', '%s' % (encrypted_filename,),
174+ '-K', '%s' % (key,),
175+ '-iv', '%s' % (iv,),
176+ '-out', '%s' % (decrypted_filename,),
177+ check_exit_code=False)
178 if err:
179 raise exception.Error(_("Failed to decrypt image file "
180 "%(image_file)s: %(err)s") %
181
182=== modified file 'nova/virt/libvirt_conn.py'
183--- nova/virt/libvirt_conn.py 2011-03-10 04:42:11 +0000
184+++ nova/virt/libvirt_conn.py 2011-03-10 14:58:44 +0000
185@@ -463,7 +463,7 @@
186 console_log = os.path.join(FLAGS.instances_path, instance['name'],
187 'console.log')
188
189- utils.execute('sudo', 'chown', s.getuid(), console_log)
190+ utils.execute('sudo', 'chown', os.getuid(), console_log)
191
192 if FLAGS.libvirt_type == 'xen':
193 # Xen is special