mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
s4-python: factorize the definition of get_dsServiceName
This commit is contained in:
@ -87,7 +87,7 @@ class dc_join(object):
|
||||
ctx.forest_domain_name = ctx.get_forest_domain_name()
|
||||
ctx.invocation_id = misc.GUID(str(uuid.uuid4()))
|
||||
|
||||
ctx.dc_ntds_dn = ctx.get_dsServiceName()
|
||||
ctx.dc_ntds_dn = ctx.samdb.get_dsServiceName()
|
||||
ctx.dc_dnsHostName = ctx.get_dnsHostName()
|
||||
ctx.behavior_version = ctx.get_behavior_version()
|
||||
|
||||
@ -207,10 +207,6 @@ class dc_join(object):
|
||||
return ctx.cldap_ret.pdc_dns_name
|
||||
|
||||
|
||||
def get_dsServiceName(ctx):
|
||||
res = ctx.samdb.search(base="", scope=ldb.SCOPE_BASE, attrs=["dsServiceName"])
|
||||
return res[0]["dsServiceName"][0]
|
||||
|
||||
def get_behavior_version(ctx):
|
||||
res = ctx.samdb.search(base=ctx.base_dn, scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"])
|
||||
if "msDS-Behavior-Version" in res[0]:
|
||||
|
Reference in New Issue
Block a user