diff options
author | Tommy Carpenter <tommy@research.att.com> | 2018-04-10 10:18:51 -0400 |
---|---|---|
committer | Tommy Carpenter <tommy@research.att.com> | 2018-04-10 10:18:53 -0400 |
commit | 931c46bb5fef8383a26c817d1b36f13780f0be65 (patch) | |
tree | 5e5d53e56cd21fb3fe09098328f3ef1e73628bd4 /config_binding_service/client.py | |
parent | a6616ada453446a076607c640cabe25fd0450426 (diff) |
Fix DCAEGEN2-429
Change-Id: I713497b454c50f415fe50b2b057c4cb9b2d703e3
Issue-ID: DCAEGEN2-429
Signed-off-by: Tommy Carpenter <tommy@research.att.com>
Diffstat (limited to 'config_binding_service/client.py')
-rw-r--r-- | config_binding_service/client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config_binding_service/client.py b/config_binding_service/client.py index 51ce3b1..a87c3bc 100644 --- a/config_binding_service/client.py +++ b/config_binding_service/client.py @@ -87,8 +87,11 @@ def _consul_get_all_as_transaction(service_component_name): new_res = {} for res in result: key = res["KV"]["Key"] - new_res[key] = json.loads(base64.b64decode( - res["KV"]["Value"]).decode("utf-8")) + val = base64.b64decode(res["KV"]["Value"]).decode("utf-8") + try: + new_res[key] = json.loads(val) + except json.decoder.JSONDecodeError: + new_res[key] = "INVALID JSON" # TODO, should we just include the original value somehow? if service_component_name not in new_res: raise CantGetConfig(404, "") |