from .cfg_app import PpCfgAppError, PpConfigApplication
-__version__ = '0.8.7'
+__version__ = '0.8.8'
LOG = logging.getLogger(__name__)
# =============================================================================
if self.verbose > 1:
LOG.debug("Target SQL:\n{}".format(tgt_sql))
+ tgt_sql_metadata = textwrap.dedent('''\
+ INSERT INTO domainmetadata (domain_id, kind, content)
+ VALUES (%(domain_id)s, %(kind)s, %(content)s)
+ ''').strip()
+ if self.verbose > 1:
+ LOG.debug("Target SQL for domain metadata:\n{}".format(tgt_sql))
+
with self.tgt_connection.cursor() as tgt_cursor:
with self.src_connection.cursor() as src_cursor:
LOG.debug("Setting account information of zone {!r} to {!r}.".format(
result['name'], cur_account))
result['account'] = cur_account
+ if self.verbose > 1:
+ LOG.debug("SQL for insert domain:\n{}".format(
+ tgt_cursor.mogrify(tgt_sql, result)))
if not self.simulate:
tgt_cursor.execute(tgt_sql, result)
+
+ # Inserting domain metadata for SOA-EDIT-DNSUPDATE
+ params = {
+ 'domain_id': dom_id,
+ 'kind': 'SOA-EDIT-DNSUPDATE',
+ 'content': 'DEFAULT',
+ }
+ if self.verbose > 1:
+ LOG.debug("SQL for insert domain metadata 1:\n{}".format(
+ tgt_cursor.mogrify(tgt_sql_metadata, params)))
+ if not self.simulate:
+ tgt_cursor.execute(tgt_sql_metadata, params)
+
+ # Inserting domain metadata for SOA-EDIT-API
+ params['kind'] = 'SOA-EDIT-API'
+ if self.verbose > 1:
+ LOG.debug("SQL for insert domain metadata 2:\n{}".format(
+ tgt_cursor.mogrify(tgt_sql_metadata, params)))
+ if not self.simulate:
+ tgt_cursor.execute(tgt_sql_metadata, params)
+
LOG.info("Imported {} domains.".format(i))
if self.tgt_db_type != 'mysql':