Merge lp:~jtran/nova/lp794651 into lp:~hudson-openstack/nova/trunk
Proposed by
John Tran
Status: | Merged |
---|---|
Approved by: | Brian Waldon |
Approved revision: | 1169 |
Merged at revision: | 1172 |
Proposed branch: | lp:~jtran/nova/lp794651 |
Merge into: | lp:~hudson-openstack/nova/trunk |
Diff against target: |
66 lines (+25/-2) 3 files modified
nova/api/ec2/cloud.py (+9/-2) nova/exception.py (+4/-0) nova/tests/test_cloud.py (+12/-0) |
To merge this branch: | bzr merge lp:~jtran/nova/lp794651 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Waldon (community) | Approve | ||
Vish Ishaya (community) | Approve | ||
Review via email: mp+63943@code.launchpad.net |
Commit message
ec2 api method allocate_address ; raises exception.
To post a comment you must log in.
Can we match the type of the inner exception as well? I don't know if we want to raise NoFloatingIpsDe fined every time we get a remote error from network.
Vish
On Jun 8, 2011, at 5:22 PM, John Tran wrote:
> John Tran has proposed merging lp:~jtran/nova/lp794651 into lp:nova. /bugs.launchpad .net/nova/ +bug/794651 /code.launchpad .net/~jtran/ nova/lp794651/ +merge/ 63943 /code.launchpad .net/~jtran/ nova/lp794651/ +merge/ 63943 ec2/cloud. py' ec2/cloud. py 2011-06-07 17:47:40 +0000 ec2/cloud. py 2011-06-09 00:22:24 +0000 address( self, context, **kwargs): _("Allocate address"), context=context) api.allocate_ floating_ ip(context) api.allocate_ floating_ ip(context) NoFloatingIpsDe fined address( self, context, public_ip, **kwargs): _("Release address %s"), public_ip, context=context) test_cloud. py' test_cloud. py 2011-06-07 20:05:03 +0000 test_cloud. py 2011-06-09 00:22:24 +0000 ip_destroy( self.context, address) address( self): allocate_ address ip_create( self.context, l(allocate( self.context) ['publicIp' ], address) ip_destroy( self.context, address) es(exception. NoFloatingIpsDe fined, allocate, disassociate_ address( self):
>
> Requested reviews:
> Nova Core (nova-core)
> Related bugs:
> Bug #794651 in OpenStack Compute (nova): "nova api allocate_address returns 'UnknownError' when no addresses available"
> https:/
>
> For more details, see:
> https:/
> --
> https:/
> You are subscribed to branch lp:nova.
> === modified file 'nova/api/
> --- nova/api/
> +++ nova/api/
> @@ -39,6 +39,7 @@
> from nova import ipv6
> from nova import log as logging
> from nova import network
> +from nova import rpc
> from nova import utils
> from nova import volume
> from nova.api.ec2 import ec2utils
> @@ -872,8 +873,11 @@
>
> def allocate_
> LOG.audit(
> - public_ip = self.network_
> - return {'publicIp': public_ip}
> + try:
> + public_ip = self.network_
> + return {'publicIp': public_ip}
> + except rpc.RemoteError:
> + raise exception.
>
> def release_
> LOG.audit(
>
> === modified file 'nova/tests/
> --- nova/tests/
> +++ nova/tests/
> @@ -115,6 +115,17 @@
> public_ip=address)
> db.floating_
>
> + def test_allocate_
> + address = "10.10.10.10"
> + allocate = self.cloud.
> + db.floating_
> + {'address': address,
> + 'host': self.network.host})
> + self.assertEqua
> + db.floating_
> + self.assertRais
> + self.context)
> +
> def test_associate_
> """Verifies associate runs cleanly without raising an exception"""
> address = "10.10.10.10"
>