diff --git a/trove/dns/designate/driver.py b/trove/dns/designate/driver.py index 43b3ebfbbf..fc0d3d5ba7 100644 --- a/trove/dns/designate/driver.py +++ b/trove/dns/designate/driver.py @@ -140,7 +140,7 @@ class DesignateInstanceEntryFactory(driver.DnsInstanceEntryFactory): def create_entry(self, instance): zone = DesignateDnsZone(id=DNS_DOMAIN_ID, name=DNS_DOMAIN_NAME) # Constructing the hostname by hashing the instance ID. - name = base64.urlsafe_b64encode(hashlib.md5(instance).digest())[:11] + name = base64.b32encode(hashlib.md5(instance).digest())[:11] hostname = ("%s.%s" % (name, zone.name)) #Removing the leading dot if present if hostname.endswith('.'): diff --git a/trove/tests/unittests/dns/test_designate_driver.py b/trove/tests/unittests/dns/test_designate_driver.py index d94b0fdd72..68e7401c5a 100644 --- a/trove/tests/unittests/dns/test_designate_driver.py +++ b/trove/tests/unittests/dns/test_designate_driver.py @@ -188,7 +188,7 @@ class DesignateInstanceEntryFactoryTest(testtools.TestCase): driver.DNS_DOMAIN_ID = '00000000-0000-0000-0000-000000000000' driver.DNS_DOMAIN_NAME = 'trove.com' driver.DNS_TTL = 3600 - hashed_id = base64.urlsafe_b64encode(hashlib.md5(instance_id).digest()) + hashed_id = base64.b32encode(hashlib.md5(instance_id).digest()) hashed_id_concat = hashed_id[:11] exp_hostname = ("%s.%s" % (hashed_id_concat, driver.DNS_DOMAIN_NAME)) factory = driver.DesignateInstanceEntryFactory() @@ -205,7 +205,7 @@ class DesignateInstanceEntryFactoryTest(testtools.TestCase): driver.DNS_DOMAIN_ID = '00000000-0000-0000-0000-000000000000' driver.DNS_DOMAIN_NAME = 'trove.com.' driver.DNS_TTL = 3600 - hashed_id = base64.urlsafe_b64encode(hashlib.md5(instance_id).digest()) + hashed_id = base64.b32encode(hashlib.md5(instance_id).digest()) hashed_id_concat = hashed_id[:11] exp_hostname = ("%s.%s" % (hashed_id_concat, driver.DNS_DOMAIN_NAME))[:-1]