1
0
mirror of https://github.com/github/octodns.git synced 2024-05-11 05:55:00 +00:00

Modernize Python 2 code to prepare for Python 3

This commit is contained in:
cclauss
2019-07-12 01:28:10 +02:00
parent 0674588a21
commit 158add8eb6
14 changed files with 76 additions and 43 deletions

View File

@@ -9,6 +9,8 @@ from collections import defaultdict
from logging import getLogger
import re
from six import text_type
from .record import Create, Delete
@@ -38,7 +40,7 @@ class Zone(object):
raise Exception('Invalid zone name {}, missing ending dot'
.format(name))
# Force everything to lowercase just to be safe
self.name = unicode(name).lower() if name else name
self.name = text_type(name).lower() if name else name
self.sub_zones = sub_zones
# We're grouping by node, it allows us to efficiently search for
# duplicates and detect when CNAMEs co-exist with other records