From 9dd035ea404474defc25c440d0d32c528abc5e45 Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Thu, 20 Jul 2017 13:37:12 +0100 Subject: [PATCH] Use _error_out_instance_on_exception in finish_resize Change I9269ffa2 removed the quota handling from finish_resize, which was the reason we weren't using _error_out_instance_on_exception there. With the removal of quota handling, the remaining code is now identical to _error_out_instance_on_exception, including the log message. This trivial non-functional change simply updates the method to use the existing utility function. Change-Id: I5e6146404132090d054deb76ecd896a1716e0405 --- nova/compute/manager.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index e2b11b4a5add..a05de058ee46 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -4003,15 +4003,10 @@ class ComputeManager(manager.Manager): new host machine. """ - try: + with self._error_out_instance_on_exception(context, instance): image_meta = objects.ImageMeta.from_dict(image) self._finish_resize(context, instance, migration, disk_info, image_meta) - except Exception: - LOG.exception('Setting instance vm_state to ERROR', - instance=instance) - with excutils.save_and_reraise_exception(): - self._set_instance_obj_error_state(context, instance) @wrap_exception() @wrap_instance_fault