1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +03:00

s4-python: factorize the definition of get_dsServiceName

This commit is contained in:
Matthieu Patou
2011-12-04 14:23:34 +01:00
parent 093dac4331
commit fc42b0ab41
4 changed files with 14 additions and 18 deletions

View File

@ -59,11 +59,6 @@ class cmd_rodc_preload(Command):
return str(res[0]["dn"])
def get_dsServiceName(self, samdb):
res = samdb.search(base="", scope=ldb.SCOPE_BASE, attrs=["dsServiceName"])
return res[0]["dsServiceName"][0]
def run(self, account, sambaopts=None,
credopts=None, versionopts=None, server=None):
@ -83,7 +78,7 @@ class cmd_rodc_preload(Command):
credentials=creds, lp=lp)
# work out the source and destination GUIDs
dc_ntds_dn = self.get_dsServiceName(samdb)
dc_ntds_dn = samdb.get_dsServiceName()
res = samdb.search(base=dc_ntds_dn, scope=ldb.SCOPE_BASE, attrs=["invocationId"])
source_dsa_invocation_id = misc.GUID(local_samdb.schema_format_value("objectGUID", res[0]["invocationId"][0]))