From 62a7ae572796f4d45790666582ff53159da03a35 Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Wed, 6 May 2015 18:05:21 +1200 Subject: [PATCH] KCC improve docstring for update_rodc_connection() Also make a short-cut early exit visually shorter and earlier. Signed-off-by: Douglas Bagnall Reviewed-by: Garming Sam Reviewed-by: Andrew Bartlett --- python/samba/kcc/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py index 9ab80b2f726..2d0283a138b 100644 --- a/python/samba/kcc/__init__.py +++ b/python/samba/kcc/__init__.py @@ -1923,9 +1923,13 @@ class KCC(object): return all_connected def update_rodc_connection(self): - """Runs when the local DC is an RODC and updates the RODC NTFRS - connection object. + """Updates the RODC NTFRS connection object. + + If the local DSA is not an RODC, this does nothing. """ + if not self.my_dsa.is_ro(): + return + # Given an nTDSConnection object cn1, such that cn1.options contains # NTDSCONN_OPT_RODC_TOPOLOGY, and another nTDSConnection object cn2, # does not contain NTDSCONN_OPT_RODC_TOPOLOGY, modify cn1 to ensure @@ -1937,9 +1941,6 @@ class KCC(object): # If no such cn2 can be found, cn1 is not modified. # If no such cn1 can be found, nothing is modified by this task. - if not self.my_dsa.is_ro(): - return - all_connections = self.my_dsa.connect_table.values() ro_connections = [x for x in all_connections if x.is_rodc_topology()] rw_connections = [x for x in all_connections