Skip to content

Commit 7f03ffa

Browse files
authored
Merge pull request #538 from sathnaga/fixup_file_read
Fixup python3: handle kickstart file read/write
2 parents fba3096 + 4ee2ec0 commit 7f03ffa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

common/OpTestInstallUtil.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,8 @@ def do_GET(self):
519519
f.close()
520520
return
521521
elif self.path == "/%s" % KS:
522-
f = open("%s/%s" % (BASE_PATH, KS), "r")
523-
d = f.read()
522+
f = open("%s/%s" % (BASE_PATH, KS), "rb")
523+
d = f.read().decode()
524524
if "hostos" in BASE_PATH:
525525
ps = d.format(REPO, PROXY, PASSWORD, DISK, DISK, DISK)
526526
elif "rhel" in BASE_PATH:
@@ -545,7 +545,7 @@ def do_GET(self):
545545
PROXY, PASSWORD, PASSWORD, user, PASSWORD, PASSWORD, DISK, packages)
546546
else:
547547
print("unknown distro")
548-
self.wfile.write(ps)
548+
self.wfile.write(ps.encode())
549549
return
550550
else:
551551
self.send_response(404)

0 commit comments

Comments
 (0)