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
This commit is contained in:
Miguel Lavalle 2016-03-09 06:39:51 +00:00
parent 69ef84e21f
commit 2dc6cb7b8d
1 changed files with 2 additions and 2 deletions

View File

@ -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)