In Python3, binascii.crc32 must be given bytes. This commit does not change the
behaviour in Python 2.
Change-Id: I91607ced4ab26d1d2e3eb31a3e4b2a4b2131b7bd
Blueprint: neutron-python3
from oslo_log import log as logging
from oslo_utils import excutils
+import six
from neutron.agent.l3 import dvr_fip_ns
from neutron.agent.l3 import dvr_router_base
"""
net = netaddr.IPNetwork(ip_cidr)
if net.version == 6:
+ if isinstance(ip_cidr, six.text_type):
+ ip_cidr = ip_cidr.encode() # Needed for Python 3.x
# the crc32 & 0xffffffff is for Python 2.6 and 3.0 compatibility
snat_idx = binascii.crc32(ip_cidr) & 0xffffffff
# xor-fold the hash to reserve upper range to extend smaller values
neutron.tests.unit.agent.test_rpc \
neutron.tests.unit.agent.test_securitygroups_rpc \
neutron.tests.unit.agent.l3.test_link_local_allocator \
+ neutron.tests.unit.agent.l3.test_dvr_local_router \
neutron.tests.unit.agent.l3.test_ha_router \
neutron.tests.unit.agent.l3.test_legacy_router \
neutron.tests.unit.agent.l3.test_router_info \