s4-drs: cope with invalid NTDS DNs from DsReplicaInfo()
authorAndrew Tridgell <tridge@samba.org>
Wed, 1 Dec 2010 05:40:17 +0000 (16:40 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Dec 2010 06:48:18 +0000 (07:48 +0100)
w2k3 sometimes returns a deleted DN

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Dec  1 07:48:19 CET 2010 on sn-devel-104

source4/scripting/python/samba/netcmd/drs.py

index 7cdb0e845a5bc99be4e1c56671986a4789c845d3..404084426a0b886e3dc72ae748ad957dfcad76d4 100644 (file)
@@ -98,9 +98,12 @@ class cmd_drs_showrepl(Command):
 
     def print_neighbour(self, n):
         '''print one set of neighbour information'''
-        (site, server) = drs_parse_ntds_dn(n.source_dsa_obj_dn)
         print("%s" % n.naming_context_dn)
-        print("\t%s\%s via RPC" % (site, server))
+        try:
+            (site, server) = drs_parse_ntds_dn(n.source_dsa_obj_dn)
+            print("\t%s\%s via RPC" % (site, server))
+        except RuntimeError:
+            print("\tNTDS DN: %s" % n.source_dsa_obj_dn)
         print("\t\tDSA object GUID: %s" % n.source_dsa_obj_guid)
         print("\t\tLast attempt @ %s %s" % (nttime2string(n.last_attempt), drs_errmsg(n.result_last_attempt)))
         print("\t\t%u consecutive failure(s)." % n.consecutive_sync_failures)