Fix API breakage due to new exceptions module
The commit ae244fcf25
broke API consumers
by moving the OctaviaClientException to a different module. Ensure it
remains available in its previous location by importing it by name.
Change-Id: I35aa0bf105c3b59abb2ff775af12198bc0436572
Story: #2006970
Task: 37698
This commit is contained in:
parent
deaa37820c
commit
400a3a73e0
|
@ -20,6 +20,8 @@ from osc_lib import exceptions as osc_exc
|
||||||
from octaviaclient.api import constants as const
|
from octaviaclient.api import constants as const
|
||||||
from octaviaclient.api import exceptions
|
from octaviaclient.api import exceptions
|
||||||
|
|
||||||
|
OctaviaClientException = exceptions.OctaviaClientException
|
||||||
|
|
||||||
|
|
||||||
def correct_return_codes(func):
|
def correct_return_codes(func):
|
||||||
_status_dict = {400: 'Bad Request', 401: 'Unauthorized',
|
_status_dict = {400: 'Bad Request', 401: 'Unauthorized',
|
||||||
|
@ -46,7 +48,7 @@ def correct_return_codes(func):
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
raise exceptions.OctaviaClientException(
|
raise OctaviaClientException(
|
||||||
code=code,
|
code=code,
|
||||||
message=message,
|
message=message,
|
||||||
request_id=request_id)
|
request_id=request_id)
|
||||||
|
|
|
@ -155,6 +155,12 @@ SINGLE_FVPF_RESP = {'flavorprofile': {'id': FAKE_FVPF, 'name': 'fvpf1'}}
|
||||||
SINGLE_FVPF_UPDATE = {'flavorprofile': {'provider_name': 'fake_provider'}}
|
SINGLE_FVPF_UPDATE = {'flavorprofile': {'provider_name': 'fake_provider'}}
|
||||||
|
|
||||||
|
|
||||||
|
class TestAPI(utils.TestCase):
|
||||||
|
def test_client_exception(self):
|
||||||
|
self.assertIs(octavia.OctaviaClientException,
|
||||||
|
exceptions.OctaviaClientException)
|
||||||
|
|
||||||
|
|
||||||
class TestOctaviaClient(utils.TestCase):
|
class TestOctaviaClient(utils.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
Loading…
Reference in New Issue