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

Proposed by Vish Ishaya
Status: Merged
Approved by: Soren Hansen
Approved revision: 607
Merged at revision: 608
Proposed branch: lp:~vishvananda/nova/lp707262
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 29 lines (+4/-7)
1 file modified
nova/virt/libvirt_conn.py (+4/-7)
To merge this branch: bzr merge lp:~vishvananda/nova/lp707262
Reviewer Review Type Date Requested Status
Soren Hansen (community) Approve
Thierry Carrez (community) Approve
Devin Carlen (community) Approve
Review via email: mp+47354@code.launchpad.net

Description of the change

Switches from project_get_network to network_get_by_instance, which actually works with all networking modes. Also removes a couple duplicate lines from a bad merge.

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
Thierry Carrez (ttx) wrote :

lgtm

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

lgtm, too.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/libvirt_conn.py'
2--- nova/virt/libvirt_conn.py 2011-01-21 09:08:21 +0000
3+++ nova/virt/libvirt_conn.py 2011-01-25 05:01:41 +0000
4@@ -643,9 +643,6 @@
5 def to_xml(self, instance, rescue=False):
6 # TODO(termie): cache?
7 LOG.debug(_('instance %s: starting toXML method'), instance['name'])
8- network = db.project_get_network(context.get_admin_context(),
9- instance['project_id'])
10- LOG.debug(_('instance %s: starting toXML method'), instance['name'])
11 network = db.network_get_by_instance(context.get_admin_context(),
12 instance['id'])
13 # FIXME(vish): stick this in db
14@@ -1362,11 +1359,11 @@
15 instance['id'])
16
17 def _dhcp_server_for_instance(self, instance):
18- network = db.project_get_network(context.get_admin_context(),
19- instance['project_id'])
20+ network = db.network_get_by_instance(context.get_admin_context(),
21+ instance['id'])
22 return network['gateway']
23
24 def _ra_server_for_instance(self, instance):
25- network = db.project_get_network(context.get_admin_context(),
26- instance['project_id'])
27+ network = db.network_get_by_instance(context.get_admin_context(),
28+ instance['id'])
29 return network['ra_server']