From f150ffb665cbefabdb61a2791c98005e5b46c433 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Fri, 14 Jul 2017 12:26:09 +0200 Subject: [PATCH] Adding etc/import-pdnsdata.ini.default --- etc/import-pdnsdata.ini.default | 39 +++++++++++++++++++++++++++++++++ pp_lib/import_pdnsdata.py | 15 ++++++------- 2 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 etc/import-pdnsdata.ini.default diff --git a/etc/import-pdnsdata.ini.default b/etc/import-pdnsdata.ini.default new file mode 100644 index 0000000..d4d186c --- /dev/null +++ b/etc/import-pdnsdata.ini.default @@ -0,0 +1,39 @@ +# Template for import-pdnsdata.ini + +[src_db] + +# Hostname of the old MySQL server (Default: mysql-pp06.pixelpark.com) +#host = mysql-pp06.pixelpark.com + +# TCP-Portnumber of the old MySQL server (Default: 3306) +#port = 3306 + +# MySQL database to use (Default: pdns) +#schema = pdns + +# MySQL user (Default: pdns) +#user = pdns + +# Password of the MySQL user (no defult) +#password = 'changeme' + +[tgt_db] + +# Hostname of the PostgreSQL server to import the data to (Default: systemshare.pixelpark.com) +#host = systemshare.pixelpark.com + +# TCP-Portnumber of the target PostgreSQL server (Default: 5432) +#port = 5432 + +# The target PostgreSQL database to use (Default: pdns) +#schema = pdns + +# PostgreSQL user (Default: pdns) +#user = pdns + +# Password of the PostgreSQL user (no defult) +#password = 'changeme' + + + +# vim: filetype=dosini diff --git a/pp_lib/import_pdnsdata.py b/pp_lib/import_pdnsdata.py index de5fa64..a1b9982 100644 --- a/pp_lib/import_pdnsdata.py +++ b/pp_lib/import_pdnsdata.py @@ -29,7 +29,7 @@ from .common import pp from .cfg_app import PpCfgAppError, PpConfigApplication -__version__ = '0.5.1' +__version__ = '0.5.2' LOG = logging.getLogger(__name__) # ============================================================================= @@ -284,7 +284,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got domains:\n{}".format(pp(results))) for result in results: @@ -340,7 +340,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got cryptokeys:\n{}".format(pp(results))) if not results: @@ -408,7 +408,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got domainmetadata:\n{}".format(pp(results))) if not results: @@ -469,7 +469,6 @@ class ImportPdnsdataApp(PpConfigApplication): if self.verbose > 1: LOG.debug("Target SQL:\n{}".format(tgt_sql)) - with self.tgt_connection.cursor() as tgt_cursor: with self.src_connection.cursor() as src_cursor: @@ -477,7 +476,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got records:\n{}".format(pp(results))) if not results: @@ -544,7 +543,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got supermasters:\n{}".format(pp(results))) if not results: @@ -589,7 +588,7 @@ class ImportPdnsdataApp(PpConfigApplication): src_cursor.execute(src_sql) results = src_cursor.fetchall() - if self.verbose > 2: + if self.verbose > 3: LOG.debug("Got tsigkeys:\n{}".format(pp(results))) if not results: -- 2.39.5