]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Gracefully handle fetching nonexistent rule
authorJohn Schwarz <jschwarz@redhat.com>
Mon, 3 Aug 2015 13:56:27 +0000 (16:56 +0300)
committerIhar Hrachyshka <ihrachys@redhat.com>
Mon, 3 Aug 2015 16:16:54 +0000 (16:16 +0000)
commit0c154ca94438e26884770742822728ecde3810e0
tree1bec2257b593da87a01c74f49b5d1f2bdac1712f
parent12ff4d6b5890c2fd1e0a3e58f974be3e1f1465ca
Gracefully handle fetching nonexistent rule

Currently, if we invoke the API for 'show rule' but the rule does not
exist, an exception is raised from deep within Neutron. This in turns
causes an uncaught exception and the user will see 'ServerFault'. This
patch proposes a fix for this scenario - the case where the rule does
not exist is handled and a NeutronException is caused, causing a proper
'NotFound' error on the client side instead.

Partially-Implements: blueprint quantum-qos-api
Change-Id: Ic703a0865d1cfa057ab1ad5290b793b22df06af6
neutron/common/exceptions.py
neutron/services/qos/qos_plugin.py
neutron/tests/api/test_qos.py