[openstack-dev] Decorator behavior

Yuriy Taraday yorik.sar at gmail.com
Tue Apr 1 09:32:10 UTC 2014


Hello.


On Mon, Mar 31, 2014 at 9:32 PM, Dan Smith <dms at danplanet.com> wrote:
>
>  >
> > (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.
>

It might be wise to add something like
https://pypi.python.org/pypi/kwonlyto all methods that are used in RPC
and modify tests appropriately to avoid
such confusion in future.

-- 

Kind regards, Yuriy.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140401/f8a25c7c/attachment.html>


More information about the OpenStack-dev mailing list