diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-07-30 19:23:23 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-07-30 19:23:23 +0000 |
| commit | 115fea1f9fa0fdb93f344a8ef9dc8ce9ba3cf6e9 (patch) | |
| tree | 56382a9b0d1d9a85a7b651bb2e48ae19ffe9f284 | |
| parent | 857328b3744eb5a12ea9c535ecc8a322a9ee11cf (diff) | |
| parent | 3ffc109e380e4a7b0d899f3881ced845abd5d58c (diff) | |
| download | nova-115fea1f9fa0fdb93f344a8ef9dc8ce9ba3cf6e9.tar.gz nova-115fea1f9fa0fdb93f344a8ef9dc8ce9ba3cf6e9.tar.xz nova-115fea1f9fa0fdb93f344a8ef9dc8ce9ba3cf6e9.zip | |
Merge "Resize.end now includes the correct instance_type"
| -rw-r--r-- | nova/compute/manager.py | 14 | ||||
| -rw-r--r-- | nova/tests/compute/test_compute.py | 4 |
2 files changed, 13 insertions, 5 deletions
diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 686409e47..1bcc23a13 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -1572,9 +1572,6 @@ class ComputeManager(manager.SchedulerDependentManager): self.compute_rpcapi.finish_resize(context, instance_ref, migration_id, image, disk_info, migration_ref['dest_compute']) - self._notify_about_instance_usage(context, instance_ref, "resize.end", - network_info=network_info) - def _finish_resize(self, context, instance, migration_ref, disk_info, image): resize_instance = False @@ -1650,6 +1647,17 @@ class ComputeManager(manager.SchedulerDependentManager): instance=instance) self._set_instance_error_state(context, instance['uuid']) + try: + network_info = self._get_instance_nw_info(context, instance) + except Exception, error: + with excutils.save_and_reraise_exception(): + msg = _('%s. Setting instance vm_state to ERROR') + LOG.error(msg % error) + self._set_instance_error_state(context, instance_uuid) + + self._notify_about_instance_usage(context, instance, "resize.end", + network_info=network_info) + @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @checks_instance_lock @wrap_instance_fault diff --git a/nova/tests/compute/test_compute.py b/nova/tests/compute/test_compute.py index c5913d9d3..848376da1 100644 --- a/nova/tests/compute/test_compute.py +++ b/nova/tests/compute/test_compute.py @@ -1,4 +1,4 @@ -# vim: tabstop=4 shiftwidth=4 softtabstop=4 +# vim: tabstop=5 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. @@ -1208,7 +1208,7 @@ class ComputeTestCase(BaseTestCase): migration_id=int(migration_ref['id']), disk_info={}, image={}, instance=instance) - self.assertEquals(len(test_notifier.NOTIFICATIONS), 2) + self.assertEquals(len(test_notifier.NOTIFICATIONS), 3) msg = test_notifier.NOTIFICATIONS[0] self.assertEquals(msg['event_type'], 'compute.instance.finish_resize.start') |
