summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorJoseph Sutton <josephsutton@catalyst.net.nz>2021-03-30 16:08:40 +1300
committerAndrew Bartlett <abartlet@samba.org>2021-04-07 10:24:17 +0000
commit2f0ef147f99374dc9543a741f3a9f2c27b904f29 (patch)
tree16ed329bd04c4f88cf766240f90c8aa9c31169ae /auth
parentc08f174c35fb0159d219f96eaf37f008d76fb41e (diff)
downloadsamba-2f0ef147f99374dc9543a741f3a9f2c27b904f29.tar.gz
auth/credentials: Remove unneeded try/except syntax
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 7 10:24:17 UTC 2021 on sn-devel-184
Diffstat (limited to 'auth')
-rwxr-xr-xauth/credentials/tests/bind.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/auth/credentials/tests/bind.py b/auth/credentials/tests/bind.py
index 0c79df4d187..ad465e94968 100755
--- a/auth/credentials/tests/bind.py
+++ b/auth/credentials/tests/bind.py
@@ -206,11 +206,8 @@ unicodePwd:: """ + base64.b64encode(u"\"P@ssw0rd\"".encode('utf-16-le')).decode(
creds_user5.set_bind_dn(self.ldb.schema_format_value("objectSid", ldb_res[0]["objectSid"][0]).decode('utf8'))
creds_user5.set_password(self.password)
print("BindTest with: " + creds_user5.get_bind_dn())
- try:
- ldb_user5 = samba.tests.connect_samdb(host, credentials=creds_user5,
- lp=lp, ldap_only=True)
- except:
- self.fail("Failed to connect with user account SID")
+ ldb_user5 = samba.tests.connect_samdb(host, credentials=creds_user5,
+ lp=lp, ldap_only=True)
res = ldb_user5.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
# do a simple bind and search with the canonical name
@@ -225,11 +222,8 @@ unicodePwd:: """ + base64.b64encode(u"\"P@ssw0rd\"".encode('utf-16-le')).decode(
creds_user7.set_bind_dn(user_dn.canonical_ex_str())
creds_user7.set_password(self.password)
print("BindTest with: " + creds_user7.get_bind_dn())
- try:
- ldb_user7 = samba.tests.connect_samdb(host, credentials=creds_user7,
- lp=lp, ldap_only=True)
- except:
- self.fail("Failed to connect with extended canonical name")
+ ldb_user7 = samba.tests.connect_samdb(host, credentials=creds_user7,
+ lp=lp, ldap_only=True)
res = ldb_user7.search(base="", expression="", scope=SCOPE_BASE, attrs=["*"])
def test_user_account_bind_no_domain(self):