Merge lp:~johannes.erdfelt/nova/lp817265 into lp:~hudson-openstack/nova/trunk

Proposed by Johannes Erdfelt
Status: Merged
Approved by: Josh Kearney
Approved revision: 1337
Merged at revision: 1338
Proposed branch: lp:~johannes.erdfelt/nova/lp817265
Merge into: lp:~hudson-openstack/nova/trunk
Diff against target: 20 lines (+2/-2)
1 file modified
nova/virt/xenapi/vmops.py (+2/-2)
To merge this branch: bzr merge lp:~johannes.erdfelt/nova/lp817265
Reviewer Review Type Date Requested Status
Josh Kearney (community) Approve
Jason Kölker (community) Approve
Vish Ishaya (community) Approve
Review via email: mp+69572@code.launchpad.net

Commit message

Make network_info truly optional

To post a comment you must log in.
Revision history for this message
Vish Ishaya (vishvananda) wrote :

is it safe to run a destroy without passing network_info? How will it tear down the networking?

review: Needs Information
Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

The code in _destroy() already treats network_info as optional. Look at like 878 in nova/virt/xenapi/vmops.py

The calls to _destroy() that don't pass any network_info are only "templates" used for snapshots and migrations. As a result, they have no network info to tear down.

This patch is merely to fix an exception where one call to _destroy() doesn't pass anything for network_info. See the linked bug.

Revision history for this message
Vish Ishaya (vishvananda) wrote :

Thanks for the explanation. In that case lgtm.

review: Approve
Revision history for this message
Jason Kölker (jason-koelker) wrote :

Is bueno. I fixed the same way in the branch I stole from cerberus.

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

This branch should have a description and/or commit message

Revision history for this message
Johannes Erdfelt (johannes.erdfelt) wrote :

I guess when Launchpad says "optional", it's misleading?

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

It's a dev policy, not a requirement on Launchpad. Just like GitHub.

Revision history for this message
Josh Kearney (jk0) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'nova/virt/xenapi/vmops.py'
2--- nova/virt/xenapi/vmops.py 2011-07-27 21:23:01 +0000
3+++ nova/virt/xenapi/vmops.py 2011-07-27 23:35:55 +0000
4@@ -471,7 +471,7 @@
5 self._session, instance, template_vdi_uuids, image_id)
6 finally:
7 if template_vm_ref:
8- self._destroy(instance, template_vm_ref, None,
9+ self._destroy(instance, template_vm_ref,
10 shutdown=False, destroy_kernel_ramdisk=False)
11
12 logging.debug(_("Finished snapshot and upload for VM %s"), instance)
13@@ -853,7 +853,7 @@
14 vm_ref = VMHelper.lookup(self._session, instance.name)
15 return self._destroy(instance, vm_ref, network_info, shutdown=True)
16
17- def _destroy(self, instance, vm_ref, network_info, shutdown=True,
18+ def _destroy(self, instance, vm_ref, network_info=None, shutdown=True,
19 destroy_kernel_ramdisk=True):
20 """Destroys VM instance by performing:
21