Fixed http status code when floating ip id is invalid.
This commit is contained in:
@@ -145,7 +145,7 @@ class NoBackendConnectionsDefined(exceptions.NeutronException):
|
|||||||
"definition. %(msg)")
|
"definition. %(msg)")
|
||||||
|
|
||||||
|
|
||||||
class FloatingIpNotFound(exceptions.NeutronException):
|
class FloatingIpNotFound(exceptions.NotFound):
|
||||||
message = _("Floating IP %(id)s not found.")
|
message = _("Floating IP %(id)s not found.")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -163,10 +163,11 @@ def update_floatingip(context, id, content):
|
|||||||
port = None
|
port = None
|
||||||
fixed_ip = None
|
fixed_ip = None
|
||||||
current_port = None
|
current_port = None
|
||||||
flip = None
|
|
||||||
|
|
||||||
with context.session.begin():
|
with context.session.begin():
|
||||||
flip = db_api.floating_ip_find(context, id=id, scope=db_api.ONE)
|
flip = db_api.floating_ip_find(context, id=id, scope=db_api.ONE)
|
||||||
|
if not flip:
|
||||||
|
raise qex.FloatingIpNotFound(id=id)
|
||||||
|
|
||||||
current_ports = flip.ports
|
current_ports = flip.ports
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user