Merge "Update NoMoreFixedIps message description"

This commit is contained in:
Jenkins 2014-10-08 13:19:58 +00:00 committed by Gerrit Code Review
commit a4df88a4ee
5 changed files with 6 additions and 6 deletions

View File

@ -1159,7 +1159,7 @@ def fixed_ip_associate_pool(context, network_id, instance_uuid=None,
# NOTE(vish): if with_lockmode isn't supported, as in sqlite,
# then this has concurrency issues
if not fixed_ip_ref:
raise exception.NoMoreFixedIps()
raise exception.NoMoreFixedIps(net=network_id)
if fixed_ip_ref['network_id'] is None:
fixed_ip_ref['network'] = network_id

View File

@ -760,7 +760,7 @@ class FixedIpInvalid(Invalid):
class NoMoreFixedIps(NovaException):
ec2_code = 'UnsupportedOperation'
msg_fmt = _("Zero fixed ips available.")
msg_fmt = _("No fixed IP addresses available for network: %(net)s")
class NoFixedIpsDefined(NotFound):

View File

@ -223,7 +223,7 @@ class API(base_api.NetworkAPI):
except neutron_client_exc.IpAddressGenerationFailureClient:
LOG.warning(_LW('Neutron error: No more fixed IPs in network: %s'),
network_id, instance=instance)
raise exception.NoMoreFixedIps()
raise exception.NoMoreFixedIps(net=network_id)
except neutron_client_exc.MacAddressInUseClient:
LOG.warning(_LW('Neutron error: MAC address %(mac)s is already '
'in use on network %(network)s.') %

View File

@ -119,7 +119,7 @@ class FixedIpTestV21(test.NoDBTestCase):
@mock.patch.object(compute.api.API, 'add_fixed_ip')
def test_add_fixed_ip_no_more_ips_available(self, mock_add_fixed_ip):
mock_add_fixed_ip.side_effect = exception.NoMoreFixedIps
mock_add_fixed_ip.side_effect = exception.NoMoreFixedIps(net='netid')
body = dict(addFixedIp=dict(networkId='test_net'))
req = webob.Request.blank(

View File

@ -168,7 +168,7 @@ def stub_out_db_network_api(stubs):
ips = filter(lambda i: i['address'] == address,
fixed_ips)
if not ips:
raise exception.NoMoreFixedIps()
raise exception.NoMoreFixedIps(net='fake_net')
ips[0]['instance'] = True
ips[0]['instance_id'] = instance_id
@ -177,7 +177,7 @@ def stub_out_db_network_api(stubs):
i['network_id'] is None) and not i['instance'],
fixed_ips)
if not ips:
raise exception.NoMoreFixedIps()
raise exception.NoMoreFixedIps(net=network_id)
ips[0]['instance'] = True
ips[0]['instance_id'] = instance_id
return ips[0]['address']