From fc42b0ab4135295fd23af5ab0cc0b410655bc376 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Sun, 4 Dec 2011 14:23:34 +0100 Subject: s4-python: factorize the definition of get_dsServiceName --- source4/scripting/python/samba/samdb.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/scripting/python/samba/samdb.py') diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py index 0ad6857cac..4bd1acde4c 100644 --- a/source4/scripting/python/samba/samdb.py +++ b/source4/scripting/python/samba/samdb.py @@ -843,3 +843,13 @@ accountExpires: %u else: self.transaction_commit() return seq + + def get_dsServiceName(self): + '''get the NTDS DN from the rootDSE''' + res = self.search(base="", scope=ldb.SCOPE_BASE, attrs=["dsServiceName"]) + return res[0]["dsServiceName"][0] + + def get_serverName(self): + '''get the server DN from the rootDSE''' + res = self.search(base="", scope=ldb.SCOPE_BASE, attrs=["serverName"]) + return res[0]["serverName"][0] -- cgit