X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=PLC%2FMethods%2FGenerateNodeConfFile.py;fp=PLC%2FMethods%2FGenerateNodeConfFile.py;h=13a17b75c654566398b09c43375af3621c8962ff;hb=aed64f31afdf04bdd6e22f3b1efdd61a2d63174a;hp=f2af06c8000fe5cbcaac54f70e00c80236720bbb;hpb=b92fd6505ef9a6e2e3532add89f0eb368bd4e2e2;p=plcapi.git diff --git a/PLC/Methods/GenerateNodeConfFile.py b/PLC/Methods/GenerateNodeConfFile.py index f2af06c..13a17b7 100644 --- 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 - bytes = random.sample(range(0, 256), 32) + int8s = random.sample(range(0, 256), 32) # 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 - node['key'] = node['key'].replace("=", "") + node['key'] = node['key'].replace(b"=", b"") # Save it node.sync()