diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-10-12 21:59:36 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-10-12 21:59:36 +0000 |
| commit | bb53babeae5b8d540bba8bb3327e8a86c8977368 (patch) | |
| tree | 0a87ee8efff38f934345f210b24f5e09899881c8 /nova/api | |
| parent | 0b971dd9120bd26e8dc534b32d01650fcb87c4f8 (diff) | |
| parent | ce04b13f26169e2d71b7d3122d3a769cb4348bf7 (diff) | |
| download | nova-bb53babeae5b8d540bba8bb3327e8a86c8977368.tar.gz nova-bb53babeae5b8d540bba8bb3327e8a86c8977368.tar.xz nova-bb53babeae5b8d540bba8bb3327e8a86c8977368.zip | |
Merge "Dis-associate an auto-assigned floating IP should return proper warning"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 3 | ||||
| -rw-r--r-- | nova/api/openstack/compute/contrib/floating_ips.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index aa7e880df..6cbaf2309 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -1196,6 +1196,9 @@ class CloudController(object): except exception.FloatingIpNotAssociated: msg = _('Floating ip is not associated.') raise exception.EC2APIError(msg) + except exception.CannotDisassociateAutoAssignedFloatingIP: + msg = _('Cannot disassociate auto assigned floating ip') + raise exception.EC2APIError(msg) return {'return': "true"} diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index b97f200da..56a6a8fad 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -96,6 +96,9 @@ def disassociate_floating_ip(self, context, instance, address): except exception.FloatingIpNotAssociated: msg = _('Floating ip is not associated') raise webob.exc.HTTPBadRequest(explanation=msg) + except exception.CannotDisassociateAutoAssignedFloatingIP: + msg = _('Cannot disassociate auto assigned floating ip') + raise webob.exc.HTTPForbidden(explanation=msg) class FloatingIPController(object): |
