Closed snoby closed 6 years ago
Running into a similar issue here. I use a token set by ~/.vault-token
.
Error was a <class 'TypeError'>, original message: the JSON object must be str, not 'bytes'"
Python version 3.5.2
This module is not modified to work with python 3 yet. There's has historically been a lot of people with old python 2.6 asking for support. I'd be open to supporting just 2.7 and 3
My playbook being a simple hello world playbook:
Works fine, as long as I work around the mac issue with fork https://github.com/jhaals/ansible-vault/issues/60. So I tried Updating to Python 3.6.4 from python.org and it has uncovered a problem with getting my access token through this plugin.
Here are my versions:
It seems to have to do with the way the post is formed: https://github.com/jhaals/ansible-vault/blob/7c4aedce730c67fb013d0db471571353838fe28d/vault.py#L171
I think this stackoverflow makes a suggestion that perhaps instead of the urllib2 request we should use the request library : https://stackoverflow.com/questions/5440485/typeerror-post-data-should-be-bytes-or-an-iterable-of-bytes-it-cannot-be-str