diff options
| author | Ryu Ishimoto <ryu@midokura.jp> | 2011-07-20 06:01:11 +0900 |
|---|---|---|
| committer | Ryu Ishimoto <ryu@midokura.jp> | 2011-07-20 06:01:11 +0900 |
| commit | f8a562edf819085820c1d6b4639f2331330cc454 (patch) | |
| tree | 18e66cd81bdbfbe145f296a35ee14f0a686e0809 /nova/compute | |
| parent | aa3df15fa304894d9e62e3282956fe406a89b136 (diff) | |
| parent | 9fe72ac7b0ed0f8e294b97e267393f352c4af97f (diff) | |
Merged lp:~danwent/nova/network-refactoring-l2
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/manager.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 960a128e0..eb52995be 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -353,7 +353,10 @@ class ComputeManager(manager.SchedulerDependentManager): {'action_str': action_str, 'instance_id': instance_id}, context=context) + network_info = None if not FLAGS.stub_network: + network_info = self.network_api.get_instance_nw_info(context, + instance) self.network_api.deallocate_for_instance(context, instance) volumes = instance.get('volumes') or [] @@ -365,7 +368,7 @@ class ComputeManager(manager.SchedulerDependentManager): self.db.instance_destroy(context, instance_id) raise exception.Error(_('trying to destroy already destroyed' ' instance: %s') % instance_id) - self.driver.destroy(instance) + self.driver.destroy(instance, network_info) if action_str == 'Terminating': terminate_volumes(self.db, context, instance_id) @@ -410,7 +413,9 @@ class ComputeManager(manager.SchedulerDependentManager): self._update_state(context, instance_id, power_state.BUILDING) - self.driver.destroy(instance_ref) + network_info = self.network_api.get_instance_nw_info(context, + instance_ref) + self.driver.destroy(instance_ref, network_info) image_ref = kwargs.get('image_ref') instance_ref.image_ref = image_ref instance_ref.injected_files = kwargs.get('injected_files', []) @@ -670,7 +675,10 @@ class ComputeManager(manager.SchedulerDependentManager): """Destroys the source instance.""" context = context.elevated() instance_ref = self.db.instance_get(context, instance_id) - self.driver.destroy(instance_ref) + + network_info = self.network_api.get_instance_nw_info(context, + instance_ref) + self.driver.destroy(instance_ref, network_info) usage_info = utils.usage_from_instance(instance_ref) notifier.notify('compute.%s' % self.host, 'compute.instance.resize.confirm', @@ -689,7 +697,9 @@ class ComputeManager(manager.SchedulerDependentManager): instance_ref = self.db.instance_get(context, instance_id) migration_ref = self.db.migration_get(context, migration_id) - self.driver.destroy(instance_ref) + network_info = self.network_api.get_instance_nw_info(context, + instance_ref) + self.driver.destroy(instance_ref, network_info) topic = self.db.queue_get_for(context, FLAGS.compute_topic, instance_ref['host']) rpc.cast(context, topic, |
