poppyred / python-consul2

Python client for the Consul HTTP API ,Continue develop on cablehead/python-consul
https://python-consul2.readthedocs.io/
MIT License
130 stars 28 forks source link

WriteRequest in body causes failure #9

Closed punkrokk closed 4 years ago

punkrokk commented 4 years ago

With Consul v1.7.0+, I get the following error:

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ec2-user/ttoozz/tooz/tooz/coordination.py", line 426, in start self._start() File "/home/ec2-user/ttoozz/tooz/tooz/drivers/consul.py", line 160, in _start token=self._acl_token) File "/home/ec2-user/tenv/lib64/python3.7/site-packages/consul/base.py", line 1740, in register params=params) File "/home/ec2-user/tenv/lib64/python3.7/site-packages/consul/std.py", line 32, in put cert=self.cert, timeout=self.timeout))) File "/home/ec2-user/tenv/lib64/python3.7/site-packages/consul/base.py", line 199, in cb CB._status(response) File "/home/ec2-user/tenv/lib64/python3.7/site-packages/consul/base.py", line 182, in _status raise BadRequest('%d %s' % (response.code, response.body)) consul.base.BadRequest: 400 Request decode failed: json: unknown field "WriteRequest"

This is due to consul implementing stricter json decoding.

I have submitted #8 that addresses this.