commit 7cf7d4a6db69d9feefd8a3b120ec272528f90eea
Author: Nikola Dipanov <email address hidden>
Date: Fri Mar 7 15:04:44 2014 +0100
Add a decorator decorator that checks func args
This patch adds a decorator for decorators that allows specifying the
arg names that the function being decorated must accept. If the function
being decorated does not accept the specified args, an exception will be
thrown during 'decoration', meaning import time usually.
If however the function accepts variable number of arguments, the
decorator will be a no-op as it is not possible to guess what will be
passed at runtime. This is however good enough for Nova's compute
manager decorators that inspired this work, as they decorate methods
with well defined and even versioned arguments.
Several decorators used in compute manager are now fortified with this
"compile time" check.
Reviewed: https:/ /review. openstack. org/78984 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=7cf7d4a6db6 9d9feefd8a3b120 ec272528f90eea
Committed: https:/
Submitter: Jenkins
Branch: master
commit 7cf7d4a6db69d9f eefd8a3b120ec27 2528f90eea
Author: Nikola Dipanov <email address hidden>
Date: Fri Mar 7 15:04:44 2014 +0100
Add a decorator decorator that checks func args
This patch adds a decorator for decorators that allows specifying the
arg names that the function being decorated must accept. If the function
being decorated does not accept the specified args, an exception will be
thrown during 'decoration', meaning import time usually.
If however the function accepts variable number of arguments, the
decorator will be a no-op as it is not possible to guess what will be
passed at runtime. This is however good enough for Nova's compute
manager decorators that inspired this work, as they decorate methods
with well defined and even versioned arguments.
Several decorators used in compute manager are now fortified with this
"compile time" check.
Partial- bug:#1296593 894ba8764699093 f59a46b8647
Change-Id: I00ebcc8a092fa0