Commit a4879a3b authored by Jérome Perrin's avatar Jérome Perrin

stack/caucase: fix for python3

hashlib.md5 needs bytes, read the file as binary to prevent

    TypeError: Unicode-objects must be encoded before hashing
parent 0803b816
......@@ -15,4 +15,4 @@
[caucase-jinja2-library]
filename = caucase.jinja2.library
md5sum = 2e7e61bb0cf41c28d6d811a0283cf03e
md5sum = 9e64eca810ae0a184917dd466808dc4f
......@@ -124,7 +124,7 @@ recipe = plone.recipe.command
checksum-file = '{{ template }}.md5'
command =
set -e
md5_current=$(${buildout:executable} -c "import hashlib ; hashlib.md5(open('{{ template }}').read()).hexdigest()")
md5_current=$(${buildout:executable} -c "import hashlib ; hashlib.md5(open('{{ template }}', 'rb').read()).hexdigest()")
md5_old=$([ -f ${:checksum-file} ] && cat ${:checksum-file} || echo none)
if [ "$md5_current" != "$md5_old" ] || [ ! -f '{{ csr }}' ] || [ ! -f '{{ key }}' ] ; then
'{{ buildout_bin_directory }}/caucase-rerequest' --template '{{ template }}' --csr '{{ csr }}' --key '{{ key }}'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment