python-consul
python-consul copied to clipboard
double quote when populating consul KV store
We are using this consul library for pulling our ansible/bitbucket-backed configuration file to the consul KV store. One issue that we have been experiencing is, certain type(e.g. String, Obj) of values that populated into the KV store will have the double quotes. For example.
Here is my configuration file:
test:
testHost: localhost:8080
After populating consul KV store:
Which will cause issue when we are trying to bind the consul KV pair to our configuration instance on the service level since the string will includes unexpected double quote.
Any ideas or suggestion?
We're experiencing the same issue. Looking through the python-consul source, I don't see where any quoting is being done explicitly, so it looks like this might be coming from the http library?
There's a check here to ensure the value being supplied to put is a string or binary type:
https://github.com/cablehead/python-consul/blob/master/consul/base.py#L513
It sounds like coming from ansible you have rich types of some sort? String
with a capital S
. Is there something that coerces these into raw strings? If so, could that coercion be adding the quotes?
My question may not even make sense, I'm not familiar with the ansible library you're using.