summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-20 13:03:59 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-20 18:52:28 +0200
commite062e7300bd2993b4a5d641ce3128f9c461f6328 (patch)
tree979e713a3fb4dbe2e85b14f702aa7e7ea1107839 /source4/scripting
parent2fb715b484d1eec3fadbdf3dc79d0fc88f01af52 (diff)
downloadsamba-e062e7300bd2993b4a5d641ce3128f9c461f6328.tar.gz
samba-e062e7300bd2993b4a5d641ce3128f9c461f6328.tar.bz2
samba-e062e7300bd2993b4a5d641ce3128f9c461f6328.zip
s4:python LDB __init__.py - remove completely unused "erase_partitions" call
Seems to be a relict from the past.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/__init__.py33
-rw-r--r--source4/scripting/python/samba/tests/provision.py3
2 files changed, 0 insertions, 36 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 915729310d..9899131aa4 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -200,39 +200,6 @@ class Ldb(_Ldb):
# Ignore missing dn errors
raise
- def erase_partitions(self):
- """Erase an ldb, removing all records."""
-
- def erase_recursive(self, dn):
- try:
- res = self.search(base=dn, scope=ldb.SCOPE_ONELEVEL, attrs=[],
- controls=["show_deleted:0"])
- except ldb.LdbError, (errno, _):
- if errno == ldb.ERR_NO_SUCH_OBJECT:
- # Ignore no such object errors
- return
-
- for msg in res:
- erase_recursive(self, msg.dn)
-
- try:
- self.delete(dn, ["relax:0"])
- except ldb.LdbError, (errno, _):
- if errno != ldb.ERR_NO_SUCH_OBJECT:
- # Ignore no such object errors
- raise
-
- res = self.search("", ldb.SCOPE_BASE, "(objectClass=*)",
- ["namingContexts"])
- assert len(res) == 1
- if not "namingContexts" in res[0]:
- return
- for basedn in res[0]["namingContexts"]:
- # Try to delete user/computer accounts to allow deletion of groups
- self.erase_users_computers(basedn)
- # Try and erase from the bottom-up in the tree
- erase_recursive(self, basedn)
-
def load_ldif_file_add(self, ldif_path):
"""Load a LDIF file.
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index aa4de660a0..aa08d1a195 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -107,7 +107,4 @@ class Disabled(object):
def test_vampire(self):
raise NotImplementedError(self.test_vampire)
- def test_erase_partitions(self):
- raise NotImplementedError(self.test_erase_partitions)
-