Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade helper script in small tests to python3 #2957

Merged
merged 1 commit into from
Nov 27, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions test/auth_external_SUITE_data/sample_external_auth.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

import sys
import pickle
Expand All @@ -15,15 +15,15 @@

def from_ejabberd():
input_length = sys.stdin.read(2)
(size,) = unpack('>h', input_length)
(size,) = unpack('>h', input_length.encode())
return sys.stdin.read(size).split(':')

def to_ejabberd(bool):
answer = 0
if bool:
answer = 1
token = pack('>hh', 2, answer)
sys.stdout.write(token)
sys.stdout.write(token.decode("utf-8"))
sys.stdout.flush()

def auth(username, server, password):
Expand Down Expand Up @@ -52,7 +52,7 @@ def removeuser(username, server):
return True

def serialize():
f = open(outfile, 'a')
f = open(outfile, 'ab')
pickle.dump(users, f)
f.close()

Expand All @@ -72,4 +72,3 @@ def serialize():
elif data[0] == "removeuser3":
success = removeuser3(data[1], data[2], data[3])
to_ejabberd(success)