mirror of
https://github.com/samba-team/samba.git
synced 2025-07-30 19:42:05 +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
|
||||
# is programatically amiss
|
||||
try:
|
||||
#XXX msg is never used
|
||||
msg = samdb.search(base=self.dnstr, scope=ldb.SCOPE_BASE)
|
||||
found = True
|
||||
# we don't use the search result, but it tests the status
|
||||
# of self.dnstr in the database.
|
||||
samdb.search(base=self.dnstr, scope=ldb.SCOPE_BASE)
|
||||
|
||||
except ldb.LdbError, (enum, estr):
|
||||
if enum == ldb.ERR_NO_SUCH_OBJECT:
|
||||
found = False
|
||||
else:
|
||||
raise Exception("Unable to search for (%s) - (%s)" %
|
||||
(self.dnstr, estr))
|
||||
if not found:
|
||||
raise Exception("nTDSConnection for (%s) doesn't exist!" %
|
||||
self.dnstr)
|
||||
raise KCCError("nTDSConnection for (%s) doesn't exist!" %
|
||||
self.dnstr)
|
||||
raise KccError("Unable to search for (%s) - (%s)" %
|
||||
(self.dnstr, estr))
|
||||
|
||||
if self.enabled:
|
||||
enablestr = "TRUE"
|
||||
|
Reference in New Issue
Block a user