Ensure that reserve and unreserve exit when an address is not found

This commit is contained in:
Alex Meade
2011-08-22 17:08:11 -04:00
parent 6e0c0aff4e
commit 1230f45ec3

View File

@@ -611,6 +611,8 @@ class FixedIpCommands(object):
try:
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'],
{'reserved': reserved})
except exception.NotFound as ex: