Comment 2 for bug 1668828

Revision history for this message
Matt Riedemann (mriedem) wrote : Re: test_list_servers_filtered_by_ip fails ccasionally

The bug is actually in nova here:

https://github.com/openstack/nova/blob/3a2a181796664fea7f6069d49f9cd367b8cff825/nova/compute/api.py#L2508

As demonstrated in this example:

>>> import re
>>> ipv4_f = re.compile(str('10.1.1.1'))
>>> address1 = '10.1.1.1'
>>> address2 = '10.1.1.10'
>>> addresses = (address1, address2)
>>> for addr in addresses:
... if ipv4_f.match(addr):
... print 'match found on address: %s' % addr
...
match found on address: 10.1.1.1
match found on address: 10.1.1.10
>>>

Nova should probably just attempt to do an exact match and if none found, then do the regex match but rather than return the first match, return all matches.