Ensure that reserve and unreserve exit when an address is not found
This commit is contained in:
@@ -611,6 +611,8 @@ class FixedIpCommands(object):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
fixed_ip = db.fixed_ip_get_by_address(ctxt, address)
|
fixed_ip = db.fixed_ip_get_by_address(ctxt, address)
|
||||||
|
if fixed_ip is None:
|
||||||
|
raise exception.NotFound('Could not find address')
|
||||||
db.fixed_ip_update(ctxt, fixed_ip['address'],
|
db.fixed_ip_update(ctxt, fixed_ip['address'],
|
||||||
{'reserved': reserved})
|
{'reserved': reserved})
|
||||||
except exception.NotFound as ex:
|
except exception.NotFound as ex:
|
||||||
|
|||||||
Reference in New Issue
Block a user