Comment 2 for bug 1296593

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/78984
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7cf7d4a6db69d9feefd8a3b120ec272528f90eea
Submitter: Jenkins
Branch: master

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.

    Partial-bug:#1296593
    Change-Id: I00ebcc8a092fa0894ba8764699093f59a46b8647