Skip to content

Commit

Permalink
Return 404 errors when FIPs are not found
Browse files Browse the repository at this point in the history
Change-Id: I5cd04deb28e67a997b99435aa72095b11d2f9948
Partial-Bug: #1481251
  • Loading branch information
eonpatapon committed Aug 4, 2015
1 parent 066ca59 commit 3c95a73
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -28,7 +28,11 @@ class FloatingIpMixin(object):
def _neutron_dict_to_fip_obj(self, fip_q, is_admin=False,
tenant_id=None, fip_obj=None):
if not fip_obj:
fip_obj = self._resource_get(id=fip_q['id'])
try:
fip_obj = self._resource_get(id=fip_q['id'])
except vnc_exc.NoIdError:
self._raise_contrail_exception('FloatingIPNotFound',
floatingip_id=fip_q['id'])

vmi_get_handler = vmi_handler.VMInterfaceGetHandler(
self._vnc_lib)
Expand Down Expand Up @@ -163,7 +167,11 @@ class FloatingIpDeleteHandler(res_handler.ResourceDeleteHandler):
resource_delete_method = 'floating_ip_delete'

def resource_delete(self, context, fip_id):
self._resource_delete(id=fip_id)
try:
self._resource_delete(id=fip_id)
except vnc_exc.NoIdError:
self._raise_contrail_exception('FloatingIPNotFound',
floatingip_id=fip_id)


class FloatingIpUpdateHandler(res_handler.ResourceUpdateHandler,
Expand Down

0 comments on commit 3c95a73

Please sign in to comment.