Fix kwargs['migration'] KeyError in @errors_out_migration

Bug #1445674 reported by Christine Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Christine Wang

Bug Description

This is similar to bug #1423952.
We need to handle that 'migration' can be in args or kwargs.
It should follow the same fix for bug 1423952.

This fixes the KeyError in the decorator by normalizing the args/kwargs
list into a single dict that we can pull the migration from.

2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 88, in wrapped
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher payload)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/exception.py", line 71, in wrapped
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher return f(self, context, *args, **kw)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 328, in decorated_function
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher LOG.warning(msg, e, instance_uuid=instance_uuid)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 85, in __exit__
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 299, in decorated_function
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 378, in decorated_function
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher return function(self, context, *args, **kwargs)
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher File "/usr/lib/python2.7/site-packages/nova/compute/manager.py", line 276, in decorated_function
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher migration = kwargs['migration']
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher KeyError: 'migration'
2015-04-17 04:53:26.418 23056 TRACE oslo_messaging.rpc.dispatcher

Christine Wang (ijuwang)
Changed in nova:
assignee: nobody → Christine Wang (ijuwang)
Revision history for this message
Tushar Patil (tpatil) wrote :

Patch https://review.openstack.org/#/c/174288 will fix this issue.

Revision history for this message
Christine Wang (ijuwang) wrote :

Great.. Thank you.
I noticed during testing, the wrap_instance_fault would have the same issue. Should I open a different bug on this or convert this one to address that issue since the errors_out_migration is already fixed.

Revision history for this message
Tushar Patil (tpatil) wrote :

I think you should open a new bug to fix wrap_instance_fault issue and mark this bug as a duplicate of #1444300.
Thank you.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.