diff options
author | Nadezhda Ivanova <nivanova@samba.org> | 2010-11-24 17:47:27 +0200 |
---|---|---|
committer | Nadezhda Ivanova <nivanova@samba.org> | 2010-11-25 01:09:27 +0200 |
commit | db5bcb7115991bb1289cad471190fd73139ea53e (patch) | |
tree | 6a1f0e977249480353f148ce71b667c41d1d7bd7 /source4/scripting | |
parent | 64424bb1c3a1714371cf7dd9d2e0ff52777b7874 (diff) | |
download | samba-db5bcb7115991bb1289cad471190fd73139ea53e.tar.gz samba-db5bcb7115991bb1289cad471190fd73139ea53e.tar.bz2 samba-db5bcb7115991bb1289cad471190fd73139ea53e.zip |
s4-tests: Added a common definition of delete_force.
Diffstat (limited to 'source4/scripting')
-rw-r--r-- | source4/scripting/python/samba/tests/__init__.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/__init__.py b/source4/scripting/python/samba/tests/__init__.py index 0519fd8dc5..2248292b89 100644 --- a/source4/scripting/python/samba/tests/__init__.py +++ b/source4/scripting/python/samba/tests/__init__.py @@ -175,3 +175,9 @@ def connect_samdb_ex(samdb_url, lp=None, session_info=None, # fetch RootDse res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE, attrs=["*"]) 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) |