diff options
| author | William Wolf <throughnothing@gmail.com> | 2011-06-13 08:54:21 -0400 |
|---|---|---|
| committer | William Wolf <throughnothing@gmail.com> | 2011-06-13 08:54:21 -0400 |
| commit | 48813099bf88a7314b396d5e04beca9a6fc3ba7c (patch) | |
| tree | d2e0a1ece6a3747708baad829fe27ced75e7def6 /nova/api | |
| parent | bd31a85575ce53dfa80f414dd359b3bdb2855292 (diff) | |
| parent | 91e34d37d2907295e892e96ca2c3039c7fbe14bf (diff) | |
| download | nova-48813099bf88a7314b396d5e04beca9a6fc3ba7c.tar.gz nova-48813099bf88a7314b396d5e04beca9a6fc3ba7c.tar.xz nova-48813099bf88a7314b396d5e04beca9a6fc3ba7c.zip | |
merge trunk
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 11 | ||||
| -rw-r--r-- | nova/api/openstack/wsgi.py | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 316298c39..e1c65ae40 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -39,6 +39,7 @@ from nova import flags 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,14 @@ class CloudController(object): def allocate_address(self, context, **kwargs): LOG.audit(_("Allocate address"), context=context) - public_ip = self.network_api.allocate_floating_ip(context) - return {'publicIp': public_ip} + try: + public_ip = self.network_api.allocate_floating_ip(context) + return {'publicIp': public_ip} + except rpc.RemoteError as ex: + if ex.exc_type == 'NoMoreAddresses': + raise exception.NoMoreFloatingIps() + else: + raise def release_address(self, context, public_ip, **kwargs): LOG.audit(_("Release address %s"), public_ip, context=context) diff --git a/nova/api/openstack/wsgi.py b/nova/api/openstack/wsgi.py index ddf4e6fa9..6760735c4 100644 --- a/nova/api/openstack/wsgi.py +++ b/nova/api/openstack/wsgi.py @@ -225,7 +225,7 @@ class XMLDictSerializer(DictSerializer): if not xmlns and self.xmlns: node.setAttribute('xmlns', self.xmlns) - return node.toprettyxml(indent=' ') + return node.toprettyxml(indent=' ', encoding='utf-8') def _to_xml_node(self, doc, metadata, nodename, data): """Recursive method to convert data members to XML nodes.""" |
