Comment 4 for bug 1520311

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to magnum (master)

Reviewed: https://review.openstack.org/263505
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=085631b71bcaa30176c109681285b97a76234e75
Submitter: Jenkins
Branch: master

commit 085631b71bcaa30176c109681285b97a76234e75
Author: Hongbin Lu <email address hidden>
Date: Mon Jan 4 20:01:57 2016 -0500

    Fixed the incorrect policy enforcement

    In API controller, "@expose.expose" should be on top of
    "@policy.enforce_wsgi". Otherwise, the output won't have the correct
    format and status code. That is because "@expose.expose" will format
    the exception before sending the response.

    In "enforce_wsgi", use decorator module instead of "functools.wraps".
    That is because decorator is signature preserving, which is
    necessary for other decorator to work.

    Also, added unit tests to ensure the correct error message and status
    code will return if the request cannot pass the policy check.

    Change-Id: I8b77ba95124c13dd1a46700bc60105bc7e33a579
    Related-Bug: #1520311