KCC: simplify get_dsa_for_implied_replica(), using IP invariant
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 25 Jun 2015 04:38:29 +0000 (16:38 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 29 Oct 2015 04:08:15 +0000 (05:08 +0100)
We only do IP transports. Therfore the long list of alternatives...

                   (not n_rep.is_domain() or
                    n_rep.is_partial() or
                    cn_conn.transport_dnstr is None or
                    cn_conn.transport_dnstr.find("CN=IP") == 0)

that ends with the equivalant of "is this IP?" always evaluates to True.

If we leave it there it will confuse people for ever.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/kcc/__init__.py

index a3c31fb672d9dc2e5d5f454a25c974fa3f914521..039d54a5f607b3e6315b2671918ce205ccd816fa 100644 (file)
@@ -845,13 +845,7 @@ class KCC(object):
         #     replica, cn!transportType has no value, or
         #     cn!transportType has an RDN of CN=IP.
         #
-        implied = (not s_rep.is_ro() or n_rep.is_partial()) and \
-                  (not n_rep.is_domain() or
-                   n_rep.is_partial() or
-                   cn_conn.transport_dnstr is None or
-                   cn_conn.transport_dnstr.find("CN=IP") == 0)
-
-        if implied:
+        if not s_rep.is_ro() or n_rep.is_partial():
             return s_dsa
         return None