Return policy error, not generic error if nova net-create/delete is forbidden by policy

Bug #1260905 reported by Tushar Kalra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Tushar Kalra

Bug Description

When nova net-create and net-delete are prohibited by policy, we should raise policy violation error (403) to the user instead of service unavailable (503) error which is incorrect.

Steps to reproduce:
1. Add the following policies to policy.json:
"network:create": "rule:admin_api",
"network:delete": "rule:admin_api"

2. As a non-admin user, run nova net-create:
$ nova net-create xyz 192.168.254.1/30
ERROR: Create networks failed (HTTP 503)

Here's the output of other forbidden commands:
$ nova baremetal-node-list
ERROR: Policy doesn't allow compute_extension:baremetal_nodes to be performed. (HTTP 403)

Tushar Kalra (tkay)
Changed in nova:
assignee: nobody → Tushar (tkay)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/62123

Changed in nova:
status: New → In Progress
Changed in nova:
importance: Undecided → Low
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/62123
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=3241155cfac7b8a3306811fc037af72cb2b63590
Submitter: Jenkins
Branch: master

commit 3241155cfac7b8a3306811fc037af72cb2b63590
Author: Tushar Kalra <email address hidden>
Date: Fri Dec 13 17:11:32 2013 -0800

    Return policy error, not generic error

    When nova net-create and net-delete are prohibited by policy, we should
    raise policy violation error (403) to the user instead of service
    unavailable (503) error which is incorrect.

    Closes-Bug: #1260905
    Change-Id: I2edc0eb09f1dc192ba47184ed24fc49e4fcd4b79

Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-2
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.