From b3df716df6e8a934f2e4f4d123d416868dfefecf Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Wed, 10 Jan 2018 16:47:03 +0100 Subject: [PATCH] Extending pp_lib/pdns_zone.py for new API keys --- pp_lib/pdns_zone.py | 47 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/pp_lib/pdns_zone.py b/pp_lib/pdns_zone.py index 265dedc..ce68151 100644 --- a/pp_lib/pdns_zone.py +++ b/pp_lib/pdns_zone.py @@ -17,13 +17,13 @@ import copy # Third party modules # Own modules -from .common import pp, to_bytes, to_utf8 +from .common import pp, to_bytes, to_utf8, to_bool from .errors import PpError from .obj import PpBaseObjectError, PpBaseObject from .pdns_record import PdnsApiRrset -__version__ = '0.4.1' +__version__ = '0.4.2' LOG = logging.getLogger(__name__) @@ -40,7 +40,8 @@ class PdnsApiZone(PpBaseObject): self, appname=None, verbose=0, version=__version__, base_dir=None, initialized=None, account=None, dnssec=False, id=None, kind=None, last_check=None, masters=None, name=None, notified_serial=None, serial=None, url=None, - rrsets=None, soa_edit=None, soa_edit_api=None): + rrsets=None, soa_edit=None, soa_edit_api=None, nsec3narrow=None, nsec3param=None, + presigned=None, api_rectify=None): # { 'account': 'local', # 'dnssec': False, @@ -64,6 +65,18 @@ class PdnsApiZone(PpBaseObject): self._notified_serial = notified_serial self._serial = serial self._url = url + self._nsec3narrow = None + if nsec3narrow is not None: + self._nsec3narrow = to_bool(nsec3narrow) + self._nsec3param = None + if nsec3param is not None and str(nsec3param).strip() != '': + self._nsec3param = str(nsec3param).strip() + self._presigned = None + if presigned is not None: + self._presigned = to_bool(presigned) + self._api_rectify = None + if api_rectify is not None: + self._api_rectify = to_bool(api_rectify) self.rrsets = [] self._soa_edit = soa_edit @@ -237,6 +250,30 @@ class PdnsApiZone(PpBaseObject): """The SOA edit property (API) of the zone object.""" return getattr(self, '_soa_edit_api', None) + # ----------------------------------------------------------- + @property + def nsec3narrow(self): + """Some stuff belonging to DNSSEC.""" + return getattr(self, '_nsec3narrow', None) + + # ----------------------------------------------------------- + @property + def nsec3param(self): + """Some stuff belonging to DNSSEC.""" + return getattr(self, '_nsec3param', None) + + # ----------------------------------------------------------- + @property + def presigned(self): + """Some stuff belonging to PowerDNS >= 4.1.""" + return getattr(self, '_presigned', None) + + # ----------------------------------------------------------- + @property + def api_rectify(self): + """Some stuff belonging to PowerDNS >= 4.1.""" + return getattr(self, '_api_rectify', None) + # ------------------------------------------------------------------------- def as_dict(self, short=True): """ @@ -264,6 +301,10 @@ class PdnsApiZone(PpBaseObject): res['rrsets'] = [] res['soa_edit'] = self.soa_edit res['soa_edit_api'] = self.soa_edit_api + res['nsec3narrow'] = self.nsec3narrow + res['nsec3param'] = self.nsec3param + res['presigned'] = self.presigned + res['api_rectify'] = self.api_rectify for rrset in self.rrsets: if isinstance(rrset, PpBaseObject): -- 2.39.5