summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2018-11-28 14:06:54 +0000
committerNoel Power <npower@samba.org>2018-12-10 10:38:21 +0100
commit0d73a2b0a29c108c3a0efbbe0473142046302b71 (patch)
tree7d817da50c2278b4f61abfb6501b60c2d47fd722 /python
parentd253e84a41b9f18243d57c41656d28fcd07e476a (diff)
downloadsamba-0d73a2b0a29c108c3a0efbbe0473142046302b71.tar.gz
PY3: net.change_password & net.set_password take string not bytes
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r--python/samba/join.py2
-rw-r--r--python/samba/tests/audit_log_dsdb.py4
-rw-r--r--python/samba/tests/audit_log_pass_change.py6
-rw-r--r--python/samba/tests/auth_log_pass_change.py8
4 files changed, 10 insertions, 10 deletions
diff --git a/python/samba/join.py b/python/samba/join.py
index e2aa5fdd28a..cf5d1b92b66 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -735,7 +735,7 @@ class DCJoinContext(object):
pass
ctx.net.set_password(account_name=ctx.samname,
domain_name=ctx.domain_name,
- newpassword=ctx.acct_pass.encode('utf-8'))
+ newpassword=ctx.acct_pass)
res = ctx.samdb.search(base=ctx.acct_dn, scope=ldb.SCOPE_BASE,
attrs=["msDS-KeyVersionNumber",
diff --git a/python/samba/tests/audit_log_dsdb.py b/python/samba/tests/audit_log_dsdb.py
index 82b93ccfc9c..883d27e42e7 100644
--- a/python/samba/tests/audit_log_dsdb.py
+++ b/python/samba/tests/audit_log_dsdb.py
@@ -132,7 +132,7 @@ class AuditLogDsdbTests(AuditLogTestBase):
net = Net(creds, lp, server=self.server)
password = "newPassword!!42"
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
username=USER_NAME,
oldpassword=USER_PASS)
@@ -175,7 +175,7 @@ class AuditLogDsdbTests(AuditLogTestBase):
password = "newPassword!!42"
domain = lp.get("workgroup")
- net.set_password(newpassword=password.encode('utf-8'),
+ net.set_password(newpassword=password,
account_name=USER_NAME,
domain_name=domain)
messages = self.waitForMessages(1, net, dn=dn)
diff --git a/python/samba/tests/audit_log_pass_change.py b/python/samba/tests/audit_log_pass_change.py
index a86f650ada0..dc554acd68a 100644
--- a/python/samba/tests/audit_log_pass_change.py
+++ b/python/samba/tests/audit_log_pass_change.py
@@ -109,7 +109,7 @@ class AuditLogPassChangeTests(AuditLogTestBase):
net = Net(creds, lp, server=self.server)
password = "newPassword!!42"
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
username=USER_NAME,
oldpassword=USER_PASS)
@@ -172,7 +172,7 @@ class AuditLogPassChangeTests(AuditLogTestBase):
domain = lp.get("workgroup")
try:
- net.set_password(newpassword=password.encode('utf-8'),
+ net.set_password(newpassword=password,
account_name=USER_NAME,
domain_name=domain)
self.fail("Expected exception not thrown")
@@ -211,7 +211,7 @@ class AuditLogPassChangeTests(AuditLogTestBase):
password = "newPassword!!42"
domain = lp.get("workgroup")
- net.set_password(newpassword=password.encode('utf-8'),
+ net.set_password(newpassword=password,
account_name=USER_NAME,
domain_name=domain)
diff --git a/python/samba/tests/auth_log_pass_change.py b/python/samba/tests/auth_log_pass_change.py
index 1bbb0ea6b0c..a6b3868fa04 100644
--- a/python/samba/tests/auth_log_pass_change.py
+++ b/python/samba/tests/auth_log_pass_change.py
@@ -89,7 +89,7 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
net = Net(creds, lp, server=self.server_ip)
password = "newPassword!!42"
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
username=USER_NAME,
oldpassword=USER_PASS)
@@ -117,7 +117,7 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
exception_thrown = False
try:
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
oldpassword=USER_PASS,
username=USER_NAME)
except Exception:
@@ -148,7 +148,7 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
exception_thrown = False
try:
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
oldpassword=USER_PASS,
username="badUser")
except Exception:
@@ -179,7 +179,7 @@ class AuthLogPassChangeTests(samba.tests.auth_log_base.AuthLogTestBase):
exception_thrown = False
try:
- net.change_password(newpassword=password.encode('utf-8'),
+ net.change_password(newpassword=password,
oldpassword="badPassword",
username=USER_NAME)
except Exception: