mirror of
https://github.com/samba-team/samba.git
synced 2025-08-04 08:22:08 +03:00
KCC: use KccError, simplify logic in NTDSConn.commit_modified
silence a pep8 thing. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
65fb95eda1
commit
db4e96ba06
@ -1035,19 +1035,16 @@ class NTDSConnection(object):
|
|||||||
# First verify we have this entry to ensure nothing
|
# First verify we have this entry to ensure nothing
|
||||||
# is programatically amiss
|
# is programatically amiss
|
||||||
try:
|
try:
|
||||||
#XXX msg is never used
|
# we don't use the search result, but it tests the status
|
||||||
msg = samdb.search(base=self.dnstr, scope=ldb.SCOPE_BASE)
|
# of self.dnstr in the database.
|
||||||
found = True
|
samdb.search(base=self.dnstr, scope=ldb.SCOPE_BASE)
|
||||||
|
|
||||||
except ldb.LdbError, (enum, estr):
|
except ldb.LdbError, (enum, estr):
|
||||||
if enum == ldb.ERR_NO_SUCH_OBJECT:
|
if enum == ldb.ERR_NO_SUCH_OBJECT:
|
||||||
found = False
|
raise KCCError("nTDSConnection for (%s) doesn't exist!" %
|
||||||
else:
|
self.dnstr)
|
||||||
raise Exception("Unable to search for (%s) - (%s)" %
|
raise KccError("Unable to search for (%s) - (%s)" %
|
||||||
(self.dnstr, estr))
|
(self.dnstr, estr))
|
||||||
if not found:
|
|
||||||
raise Exception("nTDSConnection for (%s) doesn't exist!" %
|
|
||||||
self.dnstr)
|
|
||||||
|
|
||||||
if self.enabled:
|
if self.enabled:
|
||||||
enablestr = "TRUE"
|
enablestr = "TRUE"
|
||||||
|
Reference in New Issue
Block a user