Fix typo in message string causing server exception

Trivialfix

Change-Id: I356a53b62047a189aca6df978e50fbb44e204d16
Closes-bug: #1599698
This commit is contained in:
Brian Haley 2016-07-07 09:49:47 -04:00
parent e1cee15c60
commit 04b1979477
2 changed files with 18 additions and 1 deletions

View File

@ -1024,7 +1024,7 @@ class L3_NAT_dbonly_mixin(l3.RouterPluginBase,
data = {'floatingip_id': fip['id'],
'internal_ip': internal_ip_address}
msg = (_('Floating IP %(floatingip_id)s is associated '
'with non-IPv4 address %s(internal_ip)s and '
'with non-IPv4 address %(internal_ip)s and '
'therefore cannot be bound.') % data)
else:
msg = (_('Cannot create floating IP and bind it to %s, '

View File

@ -2096,6 +2096,17 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
self.assertEqual(str(ip_range[-2]),
body_2['floatingip']['fixed_ip_address'])
def test_floatingip_update_invalid_fixed_ip(self):
with self.subnet() as s:
with self.port(subnet=s) as p:
with self.floatingip_with_assoc(
port_id=p['port']['id']) as fip:
self._update(
'floatingips', fip['floatingip']['id'],
{'floatingip': {'port_id': p['port']['id'],
'fixed_ip_address': '2001:db8::a'}},
expected_code=exc.HTTPBadRequest.code)
def test_first_floatingip_associate_notification(self):
with self.port() as p:
private_sub = {'subnet': {'id':
@ -2402,6 +2413,12 @@ class L3NatTestCaseBase(L3NatTestCaseMixin):
uuidutils.generate_uuid(), 'iamnotnanip')
self.assertEqual(400, res.status_int)
def test_create_floatingip_invalid_fixed_ipv6_address_returns_400(self):
# API-level test - no need to create all objects for l3 plugin
res = self._create_floatingip(self.fmt, uuidutils.generate_uuid(),
uuidutils.generate_uuid(), '2001:db8::a')
self.assertEqual(400, res.status_int)
def test_floatingip_list_with_sort(self):
with self.subnet(cidr="10.0.0.0/24") as s1,\
self.subnet(cidr="11.0.0.0/24") as s2,\