Merge lp:~vishvananda/nova/lp721646 into lp:~hudson-openstack/nova/trunk

Proposed by Vish Ishaya
Status: Merged
Approved by: Jesse Andrews
Approved revision: 702
Merged at revision: 704
Proposed branch: lp:~vishvananda/nova/lp721646
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 46 lines (+17/-19)
1 file modified
nova/compute/api.py (+17/-19)
To merge this branch: bzr merge lp:~vishvananda/nova/lp721646
Reviewer Review Type Date Requested Status
Jesse Andrews (community) Approve
Devin Carlen (community) Approve
Rick Harris (community) Approve
Review via email: mp+50435@code.launchpad.net

Description of the change

Fixes vpn images to use kernel and ramdisk specified by the image.

To post a comment you must log in.
Revision history for this message
Rick Harris (rconradharris) wrote :

lgtm

review: Approve
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jesse Andrews (anotherjesse) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/compute/api.py'
2--- nova/compute/api.py 2011-02-17 22:09:26 +0000
3+++ nova/compute/api.py 2011-02-19 05:56:53 +0000
4@@ -100,25 +100,23 @@
5 "run %s more instances of this type.") %
6 num_instances, "InstanceLimitExceeded")
7
8- is_vpn = image_id == FLAGS.vpn_image_id
9- if not is_vpn:
10- image = self.image_service.show(context, image_id)
11- if kernel_id is None:
12- kernel_id = image.get('kernel_id', None)
13- if ramdisk_id is None:
14- ramdisk_id = image.get('ramdisk_id', None)
15- # No kernel and ramdisk for raw images
16- if kernel_id == str(FLAGS.null_kernel):
17- kernel_id = None
18- ramdisk_id = None
19- LOG.debug(_("Creating a raw instance"))
20- # Make sure we have access to kernel and ramdisk (if not raw)
21- logging.debug("Using Kernel=%s, Ramdisk=%s" %
22- (kernel_id, ramdisk_id))
23- if kernel_id:
24- self.image_service.show(context, kernel_id)
25- if ramdisk_id:
26- self.image_service.show(context, ramdisk_id)
27+ image = self.image_service.show(context, image_id)
28+ if kernel_id is None:
29+ kernel_id = image.get('kernel_id', None)
30+ if ramdisk_id is None:
31+ ramdisk_id = image.get('ramdisk_id', None)
32+ # No kernel and ramdisk for raw images
33+ if kernel_id == str(FLAGS.null_kernel):
34+ kernel_id = None
35+ ramdisk_id = None
36+ LOG.debug(_("Creating a raw instance"))
37+ # Make sure we have access to kernel and ramdisk (if not raw)
38+ logging.debug("Using Kernel=%s, Ramdisk=%s" %
39+ (kernel_id, ramdisk_id))
40+ if kernel_id:
41+ self.image_service.show(context, kernel_id)
42+ if ramdisk_id:
43+ self.image_service.show(context, ramdisk_id)
44
45 if security_group is None:
46 security_group = ['default']