git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a pass on some explicit encode calls that are obviously wrong in python3; some may...
[plcapi.git]
/
PLC
/
Methods
/
GenerateNodeConfFile.py
diff --git
a/PLC/Methods/GenerateNodeConfFile.py
b/PLC/Methods/GenerateNodeConfFile.py
index
f2af06c
..
13a17b7
100644
(file)
--- a/
PLC/Methods/GenerateNodeConfFile.py
+++ b/
PLC/Methods/GenerateNodeConfFile.py
@@
-66,11
+66,11
@@
class GenerateNodeConfFile(Method):
if regenerate_node_key:
# Generate 32 random bytes
if regenerate_node_key:
# Generate 32 random bytes
-
byte
s = random.sample(range(0, 256), 32)
+
int8
s = random.sample(range(0, 256), 32)
# Base64 encode their string representation
# Base64 encode their string representation
- node['key'] = base64.b64encode(
"".join(map(chr, bytes)
))
+ node['key'] = base64.b64encode(
bytes(int8s
))
# XXX Boot Manager cannot handle = in the key
# XXX Boot Manager cannot handle = in the key
- node['key'] = node['key'].replace(
"=",
"")
+ node['key'] = node['key'].replace(
b"=", b
"")
# Save it
node.sync()
# Save it
node.sync()