1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

s4-tests: Added a common definition of delete_force.

This commit is contained in:
Nadezhda Ivanova 2010-11-24 17:47:27 +02:00
parent 64424bb1c3
commit db5bcb7115

View File

@ -175,3 +175,9 @@ def connect_samdb_ex(samdb_url, lp=None, session_info=None,
# fetch RootDse # fetch RootDse
res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE, attrs=["*"]) res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE, attrs=["*"])
return (sam_db, res[0]) return (sam_db, res[0])
def delete_force(samdb, dn):
try:
samdb.delete(dn)
except ldb.LdbError, (num, _):
assert(num == ldb.ERR_NO_SUCH_OBJECT)