]> Frank Brehm's Git Trees - pixelpark/admin-tools.git/commitdiff
Minor changes because of inserting the reverse IPv6 zone
authorFrank Brehm <frank.brehm@pixelpark.com>
Thu, 18 Jan 2018 13:09:35 +0000 (14:09 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Thu, 18 Jan 2018 13:09:35 +0000 (14:09 +0100)
pp_lib/import_pdnsdata.py

index e54c34af4969a69ab709f25e9a2f0b8ad6e9a516..8686c999e633475b87439fa87a0138189b988d22 100644 (file)
@@ -30,12 +30,13 @@ import pymysql
 
 # Own modules
 from .common import pp, to_bool, to_str
+from .common import RE_DOT_AT_END
 
 from .cfg_app import PpCfgAppError, PpConfigApplication
 
 from .pdns_record import PdnsSoaData
 
-__version__ = '0.9.1'
+__version__ = '0.9.2'
 LOG = logging.getLogger(__name__)
 
 # =============================================================================
@@ -1469,8 +1470,9 @@ class ImportPdnsdataApp(PpConfigApplication):
                         "Did not found Domain Id of zone {!r}.".format(zone_name))
             LOG.info("Using Id of zone {z!r}: {i}.".format(z=zone_name, i=domain_id))
 
+            ns_used = RE_DOT_AT_END.sub('.', nameservers[0])
             soa = PdnsSoaData(
-                primary=nameservers[0], email=mail_addr, serial=serial,
+                primary=ns_used, email=mail_addr, serial=serial,
                 refresh=refresh, retry=retry, expire=expire, ttl=ttl,
                 appname=self.appname, verbose=self.verbose,  base_dir=self.base_dir,
             )
@@ -1504,8 +1506,9 @@ class ImportPdnsdataApp(PpConfigApplication):
                         %(change_date)s, %(disabled)s, '', %(auth)s)
                 ''').strip()
             for ns in nameservers:
+                ns_used = RE_DOT_AT_END.sub('', ns)
                 data = {
-                    'domain_id': domain_id, 'name': zone_name, 'content': ns,
+                    'domain_id': domain_id, 'name': zone_name, 'content': ns_used,
                     'ttl': ttl, 'change_date': change_date, 'disabled': False, 'auth': True,
                 }
                 if self.verbose > 1: