> At run time there are decorators that behave in an unexpected manner.
> For instance, in nova/compute/manager.py when ComputeManager's
> resize_instance method is called, the "migration" positional argument
> is somehow added to kwargs (paired with the "migration" key) and is
> stripped out of the args parameters when the decorators are called.
> However, when this same method is called in
> nova/tests/compute/test_compute_mgr.py, the "migration" positional
> argument remains in args when the decorators are called.  In other
> words at run time the decorators see these arguments:
> 
> (self, context, [], {'migration': migration, 'image': image,
> 'instance': instance, 'reservations': reservations})
> 
> while when running a test case, they see these arguments:
> 
> (self, context, [instance, image, reservations, migration,
> instance_type], {})

All RPC-called methods get called with all of their arguments as keyword
arguments. I think this explains the runtime behavior you're seeing.
Tests tend to differ in this regard because test writers are human and
call the methods in the way they normally expect, passing positional
arguments when appropriate.

--Dan


_______________________________________________
OpenStack-dev mailing list
OpenStack-dev@lists.openstack.org
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to