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:
parent
1a8901a1ed
commit
681f611249
|
@ -923,12 +923,12 @@ class VethBridge(object):
|
||||||
|
|
||||||
def __init__(self, ports):
|
def __init__(self, ports):
|
||||||
self.ports = ports
|
self.ports = ports
|
||||||
self.unallocated_ports = set(self.ports)
|
self.unallocated_ports = list(self.ports)
|
||||||
|
|
||||||
def allocate_port(self):
|
def allocate_port(self):
|
||||||
try:
|
try:
|
||||||
return self.unallocated_ports.pop()
|
return self.unallocated_ports.pop()
|
||||||
except KeyError:
|
except IndexError:
|
||||||
tools.fail('All FakeBridge ports (%s) are already allocated.' %
|
tools.fail('All FakeBridge ports (%s) are already allocated.' %
|
||||||
len(self.ports))
|
len(self.ports))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue