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
=== modified file 'nova/image/s3.py'
--- nova/image/s3.py 2011-03-10 05:02:24 +0000
+++ nova/image/s3.py 2011-03-10 14:58:44 +0000
@@ -236,25 +236,32 @@
236 @staticmethod236 @staticmethod
237 def _decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,237 def _decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,
238 cloud_private_key, decrypted_filename):238 cloud_private_key, decrypted_filename):
239 key, err = utils.execute(239 key, err = utils.execute('openssl',
240 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,240 'rsautl',
241 process_input=encrypted_key,241 '-decrypt',
242 check_exit_code=False)242 '-inkey', '%s' % cloud_private_key,
243 process_input=encrypted_key,
244 check_exit_code=False)
243 if err:245 if err:
244 raise exception.Error(_("Failed to decrypt private key: %s")246 raise exception.Error(_("Failed to decrypt private key: %s")
245 % err)247 % err)
246 iv, err = utils.execute(248 iv, err = utils.execute('openssl',
247 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,249 'rsautl',
248 process_input=encrypted_iv,250 '-decrypt',
249 check_exit_code=False)251 '-inkey', '%s' % cloud_private_key,
252 process_input=encrypted_iv,
253 check_exit_code=False)
250 if err:254 if err:
251 raise exception.Error(_("Failed to decrypt initialization "255 raise exception.Error(_("Failed to decrypt initialization "
252 "vector: %s") % err)256 "vector: %s") % err)
253257
254 _out, err = utils.execute(258 _out, err = utils.execute('openssl', 'enc',
255 'openssl enc -d -aes-128-cbc -in %s -K %s -iv %s -out %s'259 '-d', '-aes-128-cbc',
256 % (encrypted_filename, key, iv, decrypted_filename),260 '-in', '%s' % (encrypted_filename,),
257 check_exit_code=False)261 '-K', '%s' % (key,),
262 '-iv', '%s' % (iv,),
263 '-out', '%s' % (decrypted_filename,),
264 check_exit_code=False)
258 if err:265 if err:
259 raise exception.Error(_("Failed to decrypt image file "266 raise exception.Error(_("Failed to decrypt image file "
260 "%(image_file)s: %(err)s") %267 "%(image_file)s: %(err)s") %
261268
=== modified file 'nova/network/linux_net.py'
--- nova/network/linux_net.py 2011-03-09 20:33:20 +0000
+++ nova/network/linux_net.py 2011-03-10 14:58:44 +0000
@@ -216,7 +216,7 @@
216 _execute('sudo', 'brctl', 'setfd', bridge, 0)216 _execute('sudo', 'brctl', 'setfd', bridge, 0)
217 # _execute("sudo brctl setageing %s 10" % bridge)217 # _execute("sudo brctl setageing %s 10" % bridge)
218 _execute('sudo', 'brctl', 'stp', bridge, 'off')218 _execute('sudo', 'brctl', 'stp', bridge, 'off')
219 _execute('sudo', 'ip', 'link', 'set', bridge, up)219 _execute('sudo', 'ip', 'link', 'set', bridge, 'up')
220 if net_attrs:220 if net_attrs:
221 # NOTE(vish): The ip for dnsmasq has to be the first address on the221 # NOTE(vish): The ip for dnsmasq has to be the first address on the
222 # bridge for it to respond to reqests properly222 # bridge for it to respond to reqests properly
@@ -330,7 +330,7 @@
330 env = {'FLAGFILE': FLAGS.dhcpbridge_flagfile,330 env = {'FLAGFILE': FLAGS.dhcpbridge_flagfile,
331 'DNSMASQ_INTERFACE': network_ref['bridge']}331 'DNSMASQ_INTERFACE': network_ref['bridge']}
332 command = _dnsmasq_cmd(network_ref)332 command = _dnsmasq_cmd(network_ref)
333 _execute(command, addl_env=env)333 _execute(*command, addl_env=env)
334334
335335
336def update_ra(context, network_id):336def update_ra(context, network_id):
@@ -370,7 +370,7 @@
370 else:370 else:
371 LOG.debug(_("Pid %d is stale, relaunching radvd"), pid)371 LOG.debug(_("Pid %d is stale, relaunching radvd"), pid)
372 command = _ra_cmd(network_ref)372 command = _ra_cmd(network_ref)
373 _execute(command)373 _execute(*command)
374 db.network_update(context, network_id,374 db.network_update(context, network_id,
375 {"ra_server":375 {"ra_server":
376 utils.get_my_linklocal(network_ref['bridge'])})376 utils.get_my_linklocal(network_ref['bridge'])})
@@ -424,30 +424,30 @@
424424
425def _dnsmasq_cmd(net):425def _dnsmasq_cmd(net):
426 """Builds dnsmasq command"""426 """Builds dnsmasq command"""
427 cmd = ['sudo -E dnsmasq',427 cmd = ['sudo', '-E', 'dnsmasq',
428 ' --strict-order',428 '--strict-order',
429 ' --bind-interfaces',429 '--bind-interfaces',
430 ' --conf-file=',430 '--conf-file=',
431 ' --domain=%s' % FLAGS.dhcp_domain,431 '--domain=%s' % FLAGS.dhcp_domain,
432 ' --pid-file=%s' % _dhcp_file(net['bridge'], 'pid'),432 '--pid-file=%s' % _dhcp_file(net['bridge'], 'pid'),
433 ' --listen-address=%s' % net['gateway'],433 '--listen-address=%s' % net['gateway'],
434 ' --except-interface=lo',434 '--except-interface=lo',
435 ' --dhcp-range=%s,static,120s' % net['dhcp_start'],435 '--dhcp-range=%s,static,120s' % net['dhcp_start'],
436 ' --dhcp-hostsfile=%s' % _dhcp_file(net['bridge'], 'conf'),436 '--dhcp-hostsfile=%s' % _dhcp_file(net['bridge'], 'conf'),
437 ' --dhcp-script=%s' % FLAGS.dhcpbridge,437 '--dhcp-script=%s' % FLAGS.dhcpbridge,
438 ' --leasefile-ro']438 '--leasefile-ro']
439 if FLAGS.dns_server:439 if FLAGS.dns_server:
440 cmd.append(' -h -R --server=%s' % FLAGS.dns_server)440 cmd += ['-h', '-R', '--server=%s' % FLAGS.dns_server]
441 return ''.join(cmd)441 return cmd
442442
443443
444def _ra_cmd(net):444def _ra_cmd(net):
445 """Builds radvd command"""445 """Builds radvd command"""
446 cmd = ['sudo -E radvd',446 cmd = ['sudo', '-E', 'radvd',
447# ' -u nobody',447# '-u', 'nobody',
448 ' -C %s' % _ra_file(net['bridge'], 'conf'),448 '-C', '%s' % _ra_file(net['bridge'], 'conf'),
449 ' -p %s' % _ra_file(net['bridge'], 'pid')]449 '-p', '%s' % _ra_file(net['bridge'], 'pid')]
450 return ''.join(cmd)450 return cmd
451451
452452
453def _stop_dnsmasq(network):453def _stop_dnsmasq(network):
454454
=== modified file 'nova/objectstore/image.py'
--- nova/objectstore/image.py 2011-03-04 05:04:49 +0000
+++ nova/objectstore/image.py 2011-03-10 14:58:44 +0000
@@ -253,25 +253,34 @@
253 @staticmethod253 @staticmethod
254 def decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,254 def decrypt_image(encrypted_filename, encrypted_key, encrypted_iv,
255 cloud_private_key, decrypted_filename):255 cloud_private_key, decrypted_filename):
256 key, err = utils.execute(256 key, err = utils.execute('openssl',
257 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,257 'rsautl',
258 process_input=encrypted_key,258 '-decrypt',
259 check_exit_code=False)259 '-inkey', '%s' % cloud_private_key,
260 process_input=encrypted_key,
261 check_exit_code=False)
260 if err:262 if err:
261 raise exception.Error(_("Failed to decrypt private key: %s")263 raise exception.Error(_("Failed to decrypt private key: %s")
262 % err)264 % err)
263 iv, err = utils.execute(265 iv, err = utils.execute('openssl',
264 'openssl rsautl -decrypt -inkey %s' % cloud_private_key,266 'rsautl',
265 process_input=encrypted_iv,267 '-decrypt',
266 check_exit_code=False)268 '-inkey', '%s' % cloud_private_key,
269 process_input=encrypted_iv,
270 check_exit_code=False)
267 if err:271 if err:
268 raise exception.Error(_("Failed to decrypt initialization "272 raise exception.Error(_("Failed to decrypt initialization "
269 "vector: %s") % err)273 "vector: %s") % err)
270274
271 _out, err = utils.execute(275 _out, err = utils.execute('openssl',
272 'openssl enc -d -aes-128-cbc -in %s -K %s -iv %s -out %s'276 'enc',
273 % (encrypted_filename, key, iv, decrypted_filename),277 '-d',
274 check_exit_code=False)278 '-aes-128-cbc',
279 '-in', '%s' % (encrypted_filename,),
280 '-K', '%s' % (key,),
281 '-iv', '%s' % (iv,),
282 '-out', '%s' % (decrypted_filename,),
283 check_exit_code=False)
275 if err:284 if err:
276 raise exception.Error(_("Failed to decrypt image file "285 raise exception.Error(_("Failed to decrypt image file "
277 "%(image_file)s: %(err)s") %286 "%(image_file)s: %(err)s") %
278287
=== modified file 'nova/virt/libvirt_conn.py'
--- nova/virt/libvirt_conn.py 2011-03-10 04:42:11 +0000
+++ nova/virt/libvirt_conn.py 2011-03-10 14:58:44 +0000
@@ -463,7 +463,7 @@
463 console_log = os.path.join(FLAGS.instances_path, instance['name'],463 console_log = os.path.join(FLAGS.instances_path, instance['name'],
464 'console.log')464 'console.log')
465465
466 utils.execute('sudo', 'chown', s.getuid(), console_log)466 utils.execute('sudo', 'chown', os.getuid(), console_log)
467467
468 if FLAGS.libvirt_type == 'xen':468 if FLAGS.libvirt_type == 'xen':
469 # Xen is special469 # Xen is special