Catch FixedIpNotFoundForAddress when create server
FixedIpNotFoundForAddress is not catched during server creation, so 500 error is reported to client side. Change-Id: I3cd45cd63c962225d6a893ad0fdeb01ecb94e784 Closes-Bug: 1522349
This commit is contained in:
parent
c087e5fcd0
commit
e1cd13f862
|
@ -627,6 +627,7 @@ class ServersController(wsgi.Controller):
|
|||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except (exception.ImageNotActive,
|
||||
exception.ImageBadRequest,
|
||||
exception.FixedIpNotFoundForAddress,
|
||||
exception.FlavorDiskTooSmall,
|
||||
exception.FlavorMemoryTooSmall,
|
||||
exception.InvalidMetadata,
|
||||
|
|
|
@ -2983,6 +2983,15 @@ class ServersControllerCreateTest(test.TestCase):
|
|||
self.controller.create,
|
||||
self.req, body=self.body)
|
||||
|
||||
@mock.patch.object(compute_api.API, 'create',
|
||||
side_effect=exception.FixedIpNotFoundForAddress(
|
||||
address='dummy'))
|
||||
def test_create_instance_raise_fixed_ip_not_found_bad_request(self,
|
||||
mock_create):
|
||||
self.assertRaises(webob.exc.HTTPBadRequest,
|
||||
self.controller.create,
|
||||
self.req, body=self.body)
|
||||
|
||||
@mock.patch.object(compute_api.API, 'create')
|
||||
def test_create_instance_invalid_personality(self, mock_create):
|
||||
codec = 'utf8'
|
||||
|
|
Loading…
Reference in New Issue