Fixes external DNS driver failure with Python 3.4

The external DNS driver uses an index computed with a division to slice strings
when calculating PTR records. In Python 3.4, this division returns a float
instead of an int, which causes the slice operation to fail leading to Python
3.4 unit tests to fail in Jenkins

Change-Id: I15ec039a095e00db9087b67557f9fab997e48648
Closes-Bug: 1554922
changes/03/290303/3
Miguel Lavalle 7 years ago
parent 69ef84e21f
commit 2dc6cb7b8d
  1. 4
      neutron/services/externaldns/drivers/designate/driver.py

@ -175,8 +175,8 @@ class Designate(driver.ExternalDNSService):
def _get_bytes_or_nybles_to_skip(self, in_addr_name):
if 'in-addr.arpa' in in_addr_name:
return (32 - CONF.designate.ipv4_ptr_zone_prefix_size) / 8
return (128 - CONF.designate.ipv6_ptr_zone_prefix_size) / 4
return int((32 - CONF.designate.ipv4_ptr_zone_prefix_size) / 8)
return int((128 - CONF.designate.ipv6_ptr_zone_prefix_size) / 4)
def delete_record_set(self, context, dns_domain, dns_name, records):
designate, designate_admin = get_clients(context)

Loading…
Cancel
Save