mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
samba_kcc: simplify NCReplica constructor
There is nothing to be gained from setting the dn and guid separately except subtle bugs. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
315f445a02
commit
81484f32f4
@ -2021,8 +2021,7 @@ class KCC(object):
|
||||
|
||||
# Create a NCReplica that matches what the local replica
|
||||
# should say. We'll use this below in our r_list
|
||||
l_of_x = NCReplica(dc_local.dsa_dnstr, dc_local.dsa_guid,
|
||||
nc_x.nc_dnstr)
|
||||
l_of_x = NCReplica(dc_local, nc_x.nc_dnstr)
|
||||
|
||||
l_of_x.identify_by_basedn(self.samdb)
|
||||
|
||||
|
@ -163,14 +163,14 @@ class NCReplica(NamingContext):
|
||||
class) and it identifies unique attributes of the DSA's replica for a NC.
|
||||
"""
|
||||
|
||||
def __init__(self, dsa_dnstr, dsa_guid, nc_dnstr):
|
||||
def __init__(self, dsa, nc_dnstr):
|
||||
"""Instantiate a Naming Context Replica
|
||||
|
||||
:param dsa_guid: GUID of DSA where replica appears
|
||||
:param nc_dnstr: NC dn string
|
||||
"""
|
||||
self.rep_dsa_dnstr = dsa_dnstr
|
||||
self.rep_dsa_guid = dsa_guid
|
||||
self.rep_dsa_dnstr = dsa.dsa_dnstr
|
||||
self.rep_dsa_guid = dsa.dsa_guid
|
||||
self.rep_default = False # replica for DSA's default domain
|
||||
self.rep_partial = False
|
||||
self.rep_ro = False
|
||||
@ -739,7 +739,7 @@ class DirectoryServiceAgent(object):
|
||||
dnstr = str(dsdn.dn)
|
||||
|
||||
if not dnstr in tmp_table:
|
||||
rep = NCReplica(self.dsa_dnstr, self.dsa_guid, dnstr)
|
||||
rep = NCReplica(self, dnstr)
|
||||
tmp_table[dnstr] = rep
|
||||
else:
|
||||
rep = tmp_table[dnstr]
|
||||
|
Loading…
Reference in New Issue
Block a user