From 4d78384cb563ea4ddaed8ffe04ec1eced1564a1c Mon Sep 17 00:00:00 2001 From: cemrealpsoy Date: Tue, 2 Aug 2016 14:32:45 +0300 Subject: [PATCH] Temporary change. Json format fixing --- opt/ahenk/base/command/commander.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opt/ahenk/base/command/commander.py b/opt/ahenk/base/command/commander.py index eb45b57..1a74287 100644 --- a/opt/ahenk/base/command/commander.py +++ b/opt/ahenk/base/command/commander.py @@ -127,7 +127,11 @@ class Commander(object): print('Wrong or missing parameter. Usage: send -p -c -m|-f | -e|-s|-w') return None - data['message'] = ast.literal_eval(str(response)) + resp = str(response).replace("\"{", "{") + resp = resp.replace("}\"", "}") + resp = resp.replace("'", "\"") + data['message'] = json.loads(resp) + # data['message'] = ast.literal_eval(str(response)) else: print('Wrong or missing parameter. Usage : %s start|stop|restart|status|clean|send')