from .cfg_app import PpCfgAppError, PpConfigApplication
-__version__ = '0.8.1'
+__version__ = '0.8.2'
LOG = logging.getLogger(__name__)
# =============================================================================
default_tgt_db_schema = 'pdns'
default_tgt_db_user = 'pdns'
+ re_is_local_account = re.compile(r'(lo[ck]al|privat|intern)', re.IGNORECASE)
+
# -------------------------------------------------------------------------
def __init__(self, appname=None, version=__version__):
i += 1
if self.is_local(result['name']):
LOG.debug("Setting zone {!r} to a local only zone.".format(result['name']))
+ cur_account = result['account']
+ if cur_account is None:
+ cur_account = ''
+ else:
+ cur_account = cur_account.strip()
+ if not self.re_is_local_account.search(cur_account):
+ if cur_account == '':
+ cur_account = 'local'
+ else:
+ cur_account += ', local'
+ if self.verbose > 1:
+ LOG.debug("Setting account information of zone {!r} to {!r}.".format(
+ result['name'], cur_account))
+ result['account'] = cur_account
if not self.simulate:
tgt_cursor.execute(tgt_sql, result)
LOG.info("Imported {} domains.".format(i))
LOG.debug("Got IPv4 network address of zone {!r}: {!r}.".format(domain, net_address))
network = ipaddress.ip_network(net_address)
if network.is_global:
- LOG.debug("The network {!r} of zone {!r} is allocated for public networks.".format(
- net_address, domain))
+ if self.verbose > 1:
+ LOG.debug("The network {!r} of zone {!r} is allocated for public networks.".format(
+ net_address, domain))
return False
LOG.debug("The network {!r} of zone {!r} is allocated for local networks.".format(
net_address, domain))