From f8c4640cc8cb7fb27daeeab652156c0acd136da7 Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Fri, 25 Aug 2017 12:29:40 -0400 Subject: [PATCH] Remove useless error handling in prep_resize The MigrationPreCheckError handling in prep_resize was added in commit e24f333cd5d3667a15c36ac502304bfb5a0e21df which at the same time added code to the libvirt driver's migrate_disk_and_power_off method to raise MigrationPreCheckError. However, migrate_disk_and_power_off is only called from the ComputeManager.resize_instance method, which is called from the ComputeManager._prep_resize method but via an RPC cast. Because of the RPC cast from the destination node _prep_resize to the source node resize_instance, the MigrationPreCheckError from the migrate_disk_and_power_off method on the source node is not going to come back and be raised out of _prep_resize, thus making the error handling in prep_resize dead (and confusing) code. This simply removes it. Change-Id: I60894e9c6f03b20dc59be8d9b01808da3980f4b1 --- nova/compute/manager.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index c9906a5e2a..504189795e 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -3794,16 +3794,6 @@ class ComputeManager(manager.Manager): self._prep_resize(context, image, instance, instance_type, filter_properties, node, clean_shutdown) - # NOTE(dgenin): This is thrown in LibvirtDriver when the - # instance to be migrated is backed by LVM. - # Remove when LVM migration is implemented. - except exception.MigrationPreCheckError: - # TODO(mriedem): How is it even possible to get here? - # _prep_resize does not call the driver. The resize_instance - # method does, but we RPC cast to the source node to do that - # so we shouldn't even get this exception... - failed = True - raise except Exception: failed = True # try to re-schedule the resize elsewhere: