diff options
author | Matthieu Patou <mat@matws.net> | 2011-12-04 14:23:34 +0100 |
---|---|---|
committer | Matthieu Patou <mat@matws.net> | 2011-12-05 18:23:07 +0100 |
commit | fc42b0ab4135295fd23af5ab0cc0b410655bc376 (patch) | |
tree | 01ff8cc0159fb4952c39f1d686b94c4cb5ade8e1 /source4/scripting/python/samba/samdb.py | |
parent | 093dac43312c97a90b68f18ccc80716db84c25f5 (diff) | |
download | samba-fc42b0ab4135295fd23af5ab0cc0b410655bc376.tar.gz samba-fc42b0ab4135295fd23af5ab0cc0b410655bc376.tar.bz2 samba-fc42b0ab4135295fd23af5ab0cc0b410655bc376.zip |
s4-python: factorize the definition of get_dsServiceName
Diffstat (limited to 'source4/scripting/python/samba/samdb.py')
-rw-r--r-- | source4/scripting/python/samba/samdb.py | 10 |
1 files changed, 10 insertions, 0 deletions
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] |