add exceptions package

As per the discussion in [1] extension specific exceptions that are
not API facing would best live outside the api-def itself. This patch
suggests added an exceptions package that will allow per-component
exception definitions as sub-modules (ex: neutron_lib.exceptions.l3).
The existing exceptions from neutron_lib.exceptions.py are defined
in neutron_lib.exceptions.__init__ and don't impact existing consumers
import them.

[1] https://review.openstack.org/#/c/423289/

Change-Id: Ie0797f25b99c68bdf5cc1a58c6b906cf850699a4
This commit is contained in:
Boden R 2017-02-13 12:34:04 -07:00
parent 12c3a82756
commit b328eff733
5 changed files with 7 additions and 1 deletions

View File

@ -20,7 +20,7 @@ Tests for `neutron_lib.callback.exceptions` module.
import functools
import neutron_lib.callbacks.exceptions as ex
from neutron_lib.tests.unit import test_exceptions
from neutron_lib.tests.unit.exceptions import test_exceptions
class TestCallbackExceptions(test_exceptions.TestExceptions):

View File

@ -0,0 +1,6 @@
---
features:
- A new ``neutron_lib.exceptions`` package is now available where the
existing definitions from the ``exceptions`` module are now in
``neutron_lib.exceptions.__init__`` and subsequent per-component
exceptions can be created in their own exceptions sub-module.