View Code? Open in Web Editor
NEW
[DEPRECATED] Python client for Consul
Home Page: http://consul.io
License: MIT License
Shell 1.95%
Python 98.05%
pyconsul's People
Contributors
pyconsul's Issues
When trying to retreive a recursive KV set, and any value for any key is Null (None), an exception is raised and nothing is returned.
I fixed this by changing the following lines in utils.py (and added locally to my project for now)
def decode_values(fct):
''' Decode base64 encoded responses from Consul storage '''
def inner(*args, **kwargs):
''' decorator '''
data = fct(*args, **kwargs)
if 'error' not in data:
for result in data:
if result['Value']: ## added if to handle null values
result['Value'] = base64.b64decode(result['Value'])
elif not result['Value']: ## return an empty string instead
result['Value'] = base64.b64decode(" ")
return data
return inner