|
1584 |
dc = object['attributes'].get('dc') |
1584 |
dc = object['attributes'].get('dc') |
1585 |
if oc and 'dnsZone' in oc: |
1585 |
if oc and 'dnsZone' in oc: |
1586 |
# forward or reverse zone |
1586 |
# forward or reverse zone |
1587 |
if dc and dc[0].endswith('in-addr.arpa'): |
1587 |
if dc: |
1588 |
return 'reverse_zone' |
1588 |
if dc[0].endswith('.in-addr.arpa'): |
1589 |
else: |
1589 |
return 'reverse_zone' |
1590 |
return 'forward_zone' |
1590 |
elif 'deleted_dn' in object and dc[0].find('.in-addr.arpa\nDEL:') != -1: |
|
|
1591 |
return 'reverse_zone' |
1592 |
else: |
1593 |
return 'forward_zone' |
1591 |
if oc and 'dnsNode' in oc: |
1594 |
if oc and 'dnsNode' in oc: |
1592 |
if dc and dc[0] == '@': |
1595 |
if dc: |
|
|
1596 |
if 'deleted_dn' in object: |
1597 |
ud.debug(ud.LDAP, ud.INFO, '_identify_dns_con_object: deleted_dn in object') |
1598 |
if 'deleted_dn' in object and dc[0].startswith('@\nDEL:') != -1: |
1599 |
ud.debug(ud.LDAP, ud.INFO, '_identify_dns_con_object: .startswith DEL') |
1600 |
if dc and (dc[0] == '@' or ('deleted_dn' in object and dc[0].startswith('@\nDEL:') != -1)): |
1593 |
zone_type = 'forward_zone' |
1601 |
zone_type = 'forward_zone' |
1594 |
exploded_dn = ldap.dn.str2dn(unicode_to_utf8(object['dn'])) |
1602 |
exploded_dn = ldap.dn.str2dn(unicode_to_utf8(object['dn'])) |
1595 |
for multi_rdn in exploded_dn: |
1603 |
for multi_rdn in exploded_dn: |
|
|
1604 |
ud.debug(ud.LDAP, ud.INFO, 'multi_rdn: %s' % (multi_rdn[0],)) |
1596 |
(attribute, value, _flags) = multi_rdn[0] |
1605 |
(attribute, value, _flags) = multi_rdn[0] |
|
|
1606 |
ud.debug(ud.LDAP, ud.INFO, 'attribute: %s, value: %s' % (attribute, value)) |
1597 |
if attribute.lower() == 'zonename' and value.lower().endswith('in-addr.arpa'): |
1607 |
if attribute.lower() == 'zonename' and value.lower().endswith('in-addr.arpa'): |
1598 |
zone_type = 'reverse_zone' |
1608 |
zone_type = 'reverse_zone' |
1599 |
break |
1609 |
break |
1600 |
return zone_type |
1610 |
return zone_type |
1601 |
|
|
|
1602 |
else: |
1611 |
else: |
1603 |
dnsRecords = object['attributes'].get('dnsRecord') |
1612 |
dnsRecords = object['attributes'].get('dnsRecord') |
1604 |
if not dnsRecords: |
1613 |
if not dnsRecords: |