diff options
| author | Jenkins <jenkins@review.openstack.org> | 2013-06-04 18:43:57 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2013-06-04 18:43:57 +0000 |
| commit | aae7b7a7ec3701e2cc7a9a1fa726ba0e14520f74 (patch) | |
| tree | ebc0ed88816916c324f6e8f2331ff8919cb44fd9 /nova/api | |
| parent | 22604a972fb8369d5e826b9034e72d1478c1e7ae (diff) | |
| parent | 1b7f77f22d847803a24b66a9f6c08dc4a564bddb (diff) | |
| download | nova-aae7b7a7ec3701e2cc7a9a1fa726ba0e14520f74.tar.gz nova-aae7b7a7ec3701e2cc7a9a1fa726ba0e14520f74.tar.xz nova-aae7b7a7ec3701e2cc7a9a1fa726ba0e14520f74.zip | |
Merge "Fix postgresql failures related to Data type"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/openstack/compute/contrib/fixed_ips.py | 7 | ||||
| -rw-r--r-- | nova/api/openstack/compute/contrib/floating_ips.py | 4 |
2 files changed, 7 insertions, 4 deletions
diff --git a/nova/api/openstack/compute/contrib/fixed_ips.py b/nova/api/openstack/compute/contrib/fixed_ips.py index 8c7e4f7d3..b474b685d 100644 --- a/nova/api/openstack/compute/contrib/fixed_ips.py +++ b/nova/api/openstack/compute/contrib/fixed_ips.py @@ -31,7 +31,8 @@ class FixedIPController(object): try: fixed_ip = db.fixed_ip_get_by_address_detailed(context, id) - except exception.FixedIpNotFoundForAddress as ex: + except (exception.FixedIpNotFoundForAddress, + exception.FixedIpInvalid) as ex: raise webob.exc.HTTPNotFound(explanation=ex.format_message()) fixed_ip_info = {"fixed_ip": {}} @@ -54,6 +55,7 @@ class FixedIPController(object): def action(self, req, id, body): context = req.environ['nova.context'] authorize(context) + if 'reserve' in body: return self._set_reserved(context, id, True) elif 'unreserve' in body: @@ -67,7 +69,8 @@ class FixedIPController(object): fixed_ip = db.fixed_ip_get_by_address(context, address) db.fixed_ip_update(context, fixed_ip['address'], {'reserved': reserved}) - except exception.FixedIpNotFoundForAddress: + except (exception.FixedIpNotFoundForAddress, + exception.FixedIpInvalid) as ex: msg = _("Fixed IP %s not found") % address raise webob.exc.HTTPNotFound(explanation=msg) diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index a3d03e8de..284a211cd 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -125,7 +125,7 @@ class FloatingIPController(object): try: floating_ip = self.network_api.get_floating_ip(context, id) - except exception.NotFound: + except (exception.NotFound, exception.InvalidID): msg = _("Floating ip not found for id %s") % id raise webob.exc.HTTPNotFound(explanation=msg) @@ -173,7 +173,7 @@ class FloatingIPController(object): # get the floating ip object try: floating_ip = self.network_api.get_floating_ip(context, id) - except exception.NotFound: + except (exception.NotFound, exception.InvalidID): msg = _("Floating ip not found for id %s") % id raise webob.exc.HTTPNotFound(explanation=msg) address = floating_ip['address'] |
