From d4388320e3b8fa54a9a4de92e770110d8af7bbef Mon Sep 17 00:00:00 2001 From: Graeme Coupar Date: Tue, 31 Oct 2017 17:20:47 +0000 Subject: [PATCH] Pre-start hook should support python3 as well as 2. --- rel/hooks/pre-start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rel/hooks/pre-start.sh b/rel/hooks/pre-start.sh index 9de8405..35fa7ab 100755 --- a/rel/hooks/pre-start.sh +++ b/rel/hooks/pre-start.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash echo "Initializing secure erlang distribution cookie..." -NEW_COOKIE=$(python -c "import base64; import os; print(base64.urlsafe_b64encode(os.urandom(64)).replace('/', '_'))") +NEW_COOKIE=$(python -c "import base64; import os; rand = os.urandom(64); print(base64.urlsafe_b64encode(os.urandom(64)).replace(b'/', b'_'))") sed -e "s/^-setcookie.*/-setcookie $NEW_COOKIE/" -i".insecure" "$VMARGS_PATH"