Exemple #1
0
 def _extract_zones(self):
     zones = []
     for zone in self._zone_regex.finditer(self._conf):
         content = zone.group('content')
         name = zone.group('name')
         # Make sure it's a master zone:
         if self._type_master_regex.search(content):
             zonefile = self._zonefile_regex.search(content).group('file')
             try:
                 zone_object = dns.zone.from_file(zonefile,
                                                  allow_include=True)
             except dns.zone.UnknownOrigin:
                 LOG.info(
                     _LI('%(zonefile)s is missing $ORIGIN, '
                         'inserting %(name)s'), {
                             'zonefile': zonefile,
                             'name': name
                         })
                 zone_object = dns.zone.from_file(zonefile,
                                                  allow_include=True,
                                                  origin=name)
             except dns.zone.NoSOA:
                 LOG.error(_LE('%s has no SOA') % zonefile)
             zones.append(Zone(zone_object))
     return zones
 def _extract_zones(self):
     zones = []
     for zone in self._zone_regex.finditer(self._conf):
         content = zone.group("content")
         name = zone.group("name")
         # Make sure it's a master zone:
         if self._type_master_regex.search(content):
             zonefile = self._zonefile_regex.search(content).group("file")
             try:
                 zone_object = dns.zone.from_file(zonefile, allow_include=True)
             except dns.zone.UnknownOrigin:
                 LOG.info(
                     _LI("%(zonefile)s is missing $ORIGIN, " "inserting %(name)s"),
                     {"zonefile": zonefile, "name": name},
                 )
                 zone_object = dns.zone.from_file(zonefile, allow_include=True, origin=name)
             except dns.zone.NoSOA:
                 LOG.error(_LE("%s has no SOA") % zonefile)
             zones.append(Zone(zone_object))
     return zones
 def _extract_zones(self):
     zones = []
     for zone in self._zone_regex.finditer(self._conf):
         content = zone.group('content')
         name = zone.group('name')
         # Make sure it's a master zone:
         if self._type_master_regex.search(content):
             zonefile = self._zonefile_regex.search(content).group('file')
             try:
                 zone_object = dns.zone.from_file(zonefile,
                                                  allow_include=True)
             except dns.zone.UnknownOrigin:
                 LOG.info('%s is missing $ORIGIN, inserting %s' %
                          (zonefile, name))
                 zone_object = dns.zone.from_file(zonefile,
                                                  allow_include=True,
                                                  origin=name)
             except dns.zone.NoSOA:
                 LOG.error('%s has no SOA' % zonefile)
             zones.append(Zone(zone_object))
     return zones