python3: use a list of IPDevice objects in tests

Fixes "TypeError: unhashable type: 'IPDevice'" in
neutron.tests.functional.agent.linux.test_ipset.IpsetManagerTestCase

IPDevice class defines an __eq__() method, which in Python 3 disables
the default __hash__() method (and cannot be used in a set). Use a list
instead as it is enough for the test

Change-Id: I09c538908e55df1b8d305265774c57df1ec42f21
This commit is contained in:
Bernard Cafarelli 2017-06-14 16:51:51 +02:00
parent 1a8901a1ed
commit 681f611249
No known key found for this signature in database
GPG Key ID: D148244A3C2462BD
1 changed files with 2 additions and 2 deletions

View File

@ -923,12 +923,12 @@ class VethBridge(object):
def __init__(self, ports):
self.ports = ports
self.unallocated_ports = set(self.ports)
self.unallocated_ports = list(self.ports)
def allocate_port(self):
try:
return self.unallocated_ports.pop()
except KeyError:
except IndexError:
tools.fail('All FakeBridge ports (%s) are already allocated.' %
len(self.ports))