From: Frank Brehm Date: Wed, 8 Nov 2017 17:10:57 +0000 (+0100) Subject: Adding pp_lib/deploy_zones_from_pdns.py X-Git-Tag: 0.1.2~98 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=4fb0269d23f8e00b93aa43f32f80da517f651be5;p=pixelpark%2Fadmin-tools.git Adding pp_lib/deploy_zones_from_pdns.py --- diff --git a/pp_lib/deploy_zones_from_pdns.py b/pp_lib/deploy_zones_from_pdns.py new file mode 100644 index 0000000..cea4168 --- /dev/null +++ b/pp_lib/deploy_zones_from_pdns.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +""" +@author: Frank Brehm +@contact: frank.brehm@pixelpark.com +@copyright: © 2017 by Frank Brehm, Berlin +@summary: A module for the application class for configuring named +""" +from __future__ import absolute_import + +import os +import logging +import logging.config +import textwrap +import shlex, subprocess + +from subprocess import Popen, TimeoutExpired, PIPE + +from functools import cmp_to_key + +# Third party modules +import six +from six import reraise +import requests + +from six.moves.urllib.parse import urlunsplit + +# Own modules +from .common import pp, compare_fqdn, to_str +from .common import RE_DOT_AT_END + +from .pdns_app import PpPDNSAppError, PpPDNSApplication, PDNSApiNotFoundError, PDNSApiValidationError +from .pdns_zone import PdnsApiZone +from .pdns_record import compare_rrsets + +__version__ = '0.1.1' +LOG = logging.getLogger(__name__) + + +# ============================================================================= +class PpDeployZonesError(PpPDNSAppError): + pass + + +# ============================================================================= +class PpDeployZonesApp(PpPDNSApplication): + """ + Class for a application 'dns-deploy-zones' for configuring slaves + of the BIND named daemon. + """ + + # ------------------------------------------------------------------------- + def __init__(self, appname=None, version=__version__): + + self.zones = [] + + description = textwrap.dedent('''\ + Lists all available zones from given PowerDNS API. + ''') + + super(PpPDNSShowZoneApp, self).__init__( + appname=appname, version=version, description=description, + ) + + self.initialized = True + + + +# ============================================================================= + +if __name__ == "__main__": + + pass + +# ============================================================================= + +# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 list