samba-tool ldapcmp: print DNs on predictable order
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 21 Nov 2018 02:33:57 +0000 (15:33 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Nov 2018 06:46:20 +0000 (07:46 +0100)
Rather than unstable hash order. Ideally we'd do them in proper DN order.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/ldapcmp.py

index 2118c1a780030e37ab6b7046942f3e0b02ee8080..17c62928a55ed6a457b512084465bf0dff5d1daa 100644 (file)
@@ -743,14 +743,14 @@ class LDAPBundle(object):
             if self_only:
                 res = False
                 self.log("\n* DNs found only in %s:" % self.con.host)
-                for x in self_only:
+                for x in sorted(self_only):
                     self.log(4 * " " + x)
 
             other_only = other_dns - self_dns  # missing in self
             if other_only:
                 res = False
                 self.log("\n* DNs found only in %s:" % other.con.host)
-                for x in other_only:
+                for x in sorted(other_only):
                     self.log(4 * " " + x)
 
         common_dns = self_dns & other_dns