From 51cc814e435973ab2c150fddf8fda6d08ad03547 Mon Sep 17 00:00:00 2001 From: Johannes Erdfelt Date: Wed, 19 Sep 2012 21:03:47 +0000 Subject: Call compute manager methods with instance as keyword argument reverts_task_state and wrap_instance_fault both expect to be able to find an instance keyword argument if an exception is raised while executing the wrapped function. Fix stop_instance and start_instance to call other compute manager methods with instance as a keyword argument to ensure the decorators correctly function. Only the nested call to the decorated function didn't have the instance keyword argument. As a result, the initial call would correctly perform the decorated functions. This fix will ensure that spurious and confusing log messages don't get generated. Change-Id: Id4268150f7bea8c52ecc539e1b9ea19b19967ae4 --- nova/compute/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nova/compute/manager.py b/nova/compute/manager.py index 2f977b26c..6088ba5e6 100644 --- a/nova/compute/manager.py +++ b/nova/compute/manager.py @@ -928,7 +928,7 @@ class ComputeManager(manager.SchedulerDependentManager): """Stopping an instance on this host. Alias for power_off_instance for compatibility""" - self.power_off_instance(context, instance, + self.power_off_instance(context, instance=instance, final_state=vm_states.STOPPED) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @@ -938,7 +938,7 @@ class ComputeManager(manager.SchedulerDependentManager): """Starting an instance on this host. Alias for power_on_instance for compatibility""" - self.power_on_instance(context, instance) + self.power_on_instance(context, instance=instance) @exception.wrap_exception(notifier=notifier, publisher_id=publisher_id()) @reverts_task_state -- cgit