diff --git a/neutron/plugins/nicira/NvpApiClient.py b/neutron/plugins/nicira/NvpApiClient.py index b7c32e65e2..3dcbc13b02 100644 --- a/neutron/plugins/nicira/NvpApiClient.py +++ b/neutron/plugins/nicira/NvpApiClient.py @@ -202,6 +202,7 @@ class NVPApiHelper(client_eventlet.NvpApiClientEventlet): 307: zero, 400: zero, 500: zero, + 501: zero, 503: zero} diff --git a/neutron/tests/unit/nicira/fake_nvpapiclient.py b/neutron/tests/unit/nicira/fake_nvpapiclient.py index 1aa96ccf9f..2b73d4dc0a 100644 --- a/neutron/tests/unit/nicira/fake_nvpapiclient.py +++ b/neutron/tests/unit/nicira/fake_nvpapiclient.py @@ -453,7 +453,7 @@ class FakeClient: relations = urlparse.parse_qs(parsedurl.query).get('relations') response_file = self.FAKE_GET_RESPONSES.get(res_type) if not response_file: - raise Exception("resource not found") + raise NvpApiClient.NvpApiException() if 'lport' in res_type or 'nat' in res_type: if len(uuids) > 1: return self._show(res_type, response_file, uuids[0], diff --git a/neutron/tests/unit/nicira/test_nvplib.py b/neutron/tests/unit/nicira/test_nvplib.py index 01383f6bb2..2734feb8dd 100644 --- a/neutron/tests/unit/nicira/test_nvplib.py +++ b/neutron/tests/unit/nicira/test_nvplib.py @@ -1379,6 +1379,14 @@ class TestNvplibClusterManagement(NvplibTestCase): self.assertRaises(nvp_exc.MaintenanceInProgress, nvplib.do_request, cluster=self.fake_cluster) + def test_cluster_method_not_implemetned(self): + self.assertRaises(NvpApiClient.NvpApiException, + nvplib.do_request, + nvplib.HTTP_GET, + nvplib._build_uri_path('MY_FAKE_RESOURCE', + resource_id='foo'), + cluster=self.fake_cluster) + def _nicira_method(method_name, module_name='nvplib'): return '%s.%s.%s' % ('neutron.plugins.nicira', module_name, method_name)