Fix kwargs['migration'] KeyError in @errors_out_migration decorator
@errors_out_migration decorator is used in the compute manager on
resize_instance and finish_resize methods of ComputeManager class.
It is decorated via @utils.expects_func_args('migration') to check
'migration' is a parameter to the decorator method, however, that
only ensures there is a migration argument, not that it's in args or
kwargs (either is fine for what expects_func_args checks).
The errors_out_migration decorator can get a KeyError when checking
kwargs['migration'] and fails to set the migration status to 'error'.
This fixes the KeyError in the decorator by normalizing the args/kwargs
list into a single dict that we can pull the migration from.
Change-Id: I774ac9b749b21085f4fbcafa4965a78d68eec9c7
Closes-Bug: 1444300
(cherry picked from commit 3add7923fc16c050d4cfaef98a87886c6b6a589c)
Reviewed: https:/ /review. openstack. org/175570 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=a4e9a146c39 93f5775501716a2 1632f34a63a3ad
Committed: https:/
Submitter: Jenkins
Branch: stable/kilo
commit a4e9a146c3993f5 775501716a21632 f34a63a3ad
Author: Rajesh Tailor <email address hidden>
Date: Wed Apr 15 06:59:04 2015 -0700
Fix kwargs['migration'] KeyError in @errors_ out_migration decorator
@errors_ out_migration decorator is used in the compute manager on expects_ func_args( 'migration' ) to check out_migration decorator can get a KeyError when checking 'migration' ] and fails to set the migration status to 'error'.
resize_instance and finish_resize methods of ComputeManager class.
It is decorated via @utils.
'migration' is a parameter to the decorator method, however, that
only ensures there is a migration argument, not that it's in args or
kwargs (either is fine for what expects_func_args checks).
The errors_
kwargs[
This fixes the KeyError in the decorator by normalizing the args/kwargs
list into a single dict that we can pull the migration from.
Change-Id: I774ac9b749b210 85f4fbcafa4965a 78d68eec9c7 0d4cfaef98a8788 6c6b6a589c)
Closes-Bug: 1444300
(cherry picked from commit 3add7923fc16c05