From 7ab0489bc4f15fdc6025056c2d9e08543fde5129 Mon Sep 17 00:00:00 2001 From: Mark Washenberger Date: Sun, 4 Mar 2012 23:35:17 -0500 Subject: Log a certain rare instance termination exception - Clean up logging per Michael Still's comments Change-Id: I3b7e647dde582dca4644b557bb30251e31644c17 --- nova/compute/manager.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index eee4d303c..09dbc6911 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -389,20 +389,18 @@ class ComputeManager(manager.SchedulerDependentManager): def _shutdown_instance_even_if_deleted(self, context, instance_uuid): """Call terminate_instance even for already deleted instances""" - LOG.info(_("Going to force the deletion of the vm %(instance_uuid)s, " - "even if it is deleted") % locals()) try: try: self.terminate_instance(context, instance_uuid) except exception.InstanceNotFound: - LOG.info(_("Instance %(instance_uuid)s did not exist in the " - "DB, but I will shut it down anyway using a special " - "context") % locals()) - ctxt = nova.context.get_admin_context('yes') + LOG.info(_("Instance already deleted from database. " + "Attempting forceful vm deletion"), + instance=instance_uuid) + ctxt = nova.context.get_admin_context(read_deleted='yes') self.terminate_instance(ctxt, instance_uuid) except Exception as ex: - LOG.info(_("exception terminating the instance " - "%(instance_uuid)s") % locals()) + LOG.exception(_("Exception encountered while terminating the " + "instance"), instance=instance_uuid) def _run_instance(self, context, instance_uuid, requested_networks=None, -- cgit