from subprocess import Popen, TimeoutExpired, PIPE
-from functools import cmp_to_key
-
# Third party modules
import six
from pytz import timezone, UnknownTimeZoneError
# Own modules
-from fb_tools.common import pp, compare_fqdn, to_str, to_bool
+from fb_tools.common import pp, to_str, to_bool
from .pdns_app import PpPDNSAppError, PpPDNSApplication
from .xlate import XLATOR
-__version__ = '0.6.1'
+__version__ = '0.6.2'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
# -------------------------------------------------------------------------
def __init__(self, appname=None, base_dir=None, version=__version__):
- self.zones = []
+ self.zones = {}
self.pidfile = None
self._show_simulate_opt = True
datetime.datetime.now(local_tz).strftime('%Y-%m-%d %H:%M:%S %Z')))
self.zones = self.get_api_zones()
- self.zones.sort(key=lambda x: cmp_to_key(compare_fqdn)(x.name_unicode))
self.init_temp_objects()
self.generate_slave_cfg_file()
content = header
- for zone in self.zones:
+ for zone_name in self.zones.keys():
+ zone = self.zones[zone_name]
canonical_name = zone.name_unicode
match = self.re_ipv4_zone.search(zone.name)
if match: