From 65d9f80b5bfe9e94323f31f2d109670798774466 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Tue, 18 Dec 2012 09:55:46 -0500 Subject: Update exceptions to pass correct kwargs. Updates a variety of Nova exceptions so that they pass the correct kwargs for proper exception message formatting. Previously these exceptions would work but have incorrect error messages because of how NovaException handled exception formatting errors. Change-Id: I9601d3884a72d53a8ad742cf6610399968747cea --- nova/compute/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'nova/compute') diff --git a/nova/compute/api.py b/nova/compute/api.py index cc02e4a82..757f78f2d 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1496,7 +1496,8 @@ class API(base.Base): raise exception.InstanceInvalidState( attr='task_state', instance_uuid=instance['uuid'], - state=instance['task_state']) + state=instance['task_state'], + method='reboot') state = {'SOFT': task_states.REBOOTING, 'HARD': task_states.REBOOTING_HARD}[reboot_type] instance = self.update(context, instance, vm_state=vm_states.ACTIVE, @@ -1942,7 +1943,7 @@ class API(base.Base): def get_vnc_console(self, context, instance, console_type): """Get a url to an instance Console.""" if not instance['host']: - raise exception.InstanceNotReady(instance=instance) + raise exception.InstanceNotReady(instance_id=instance['uuid']) connect_info = self.compute_rpcapi.get_vnc_console(context, instance=instance, console_type=console_type) -- cgit