From e062e7300bd2993b4a5d641ce3128f9c461f6328 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sun, 20 Jun 2010 13:03:59 +0200 Subject: s4:python LDB __init__.py - remove completely unused "erase_partitions" call Seems to be a relict from the past. --- source4/scripting/python/samba/__init__.py | 33 ----------------------- source4/scripting/python/samba/tests/provision.py | 3 --- 2 files changed, 36 deletions(-) (limited to 'source4') 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) - -- cgit