|
1614 |
zone.open( ) |
1614 |
zone.open( ) |
1615 |
zone.modify( ) |
1615 |
zone.modify( ) |
1616 |
|
1616 |
|
|
|
1617 |
|
1618 |
def __remove_related_ptrrecords(self, zoneDN, ip): |
1619 |
ptrrecord = '%s.%s.' % (self.info['name'], zoneDN.split('=')[1].split(',')[0]) |
1620 |
ip_split = ip.split('.') |
1621 |
ip_split.reverse() |
1622 |
search_filter = '(|(relativeDomainName=%s)(relativeDomainName=%s)(relativeDomainName=%s))' % (ip_split[0], '.'.join(ip_split[:1]), '.'.join(ip_split[:2])) |
1623 |
|
1624 |
for dn, attributes in self.lo.search(scope='domain', attr=['pTRRecord'], filter=search_filter): |
1625 |
if ptrrecord in attributes['pTRRecord']: |
1626 |
self.lo.modify(dn, [('pTRRecord', ptrrecord, '')]) |
1627 |
break |
1628 |
|
1629 |
|
1617 |
def check_common_name_length(self): |
1630 |
def check_common_name_length(self): |
1618 |
univention.debug.debug( univention.debug.ADMIN, univention.debug.INFO, 'check_common_name_length with self["ip"] = %r and self["dnsEntryZoneForward"] = %r' % (self['ip'], self['dnsEntryZoneForward'], )) |
1631 |
univention.debug.debug( univention.debug.ADMIN, univention.debug.INFO, 'check_common_name_length with self["ip"] = %r and self["dnsEntryZoneForward"] = %r' % (self['ip'], self['dnsEntryZoneForward'], )) |
1619 |
if len(self['ip']) > 0 and len(self['dnsEntryZoneForward']) > 0: |
1632 |
if len(self['ip']) > 0 and len(self['dnsEntryZoneForward']) > 0: |
|
1826 |
dn, ip = self.__split_dns_line( entry ) |
1839 |
dn, ip = self.__split_dns_line( entry ) |
1827 |
if not ip and not self.__multiip: |
1840 |
if not ip and not self.__multiip: |
1828 |
self.__remove_dns_forward_object( self[ 'name' ], dn, self[ 'ip' ][ 0 ] ) |
1841 |
self.__remove_dns_forward_object( self[ 'name' ], dn, self[ 'ip' ][ 0 ] ) |
|
|
1842 |
self.__remove_related_ptrrecords(dn, self['ip'][0]) |
1829 |
else: |
1843 |
else: |
1830 |
self.__remove_dns_forward_object( self[ 'name' ], dn, ip ) |
1844 |
self.__remove_dns_forward_object( self[ 'name' ], dn, ip ) |
|
|
1845 |
self.__remove_related_ptrrecords(dn, ip) |
1831 |
|
1846 |
|
1832 |
for entry in self.__changes[ 'dnsEntryZoneForward' ][ 'add' ]: |
1847 |
for entry in self.__changes[ 'dnsEntryZoneForward' ][ 'add' ]: |
1833 |
univention.debug.debug( univention.debug.ADMIN, univention.debug.INFO, 'we should add a dns forward object "%s"' % entry ) |
1848 |
univention.debug.debug( univention.debug.ADMIN, univention.debug.INFO, 'we should add a dns forward object "%s"' % entry ) |