##// END OF EJS Templates
API cli should prefer to display errors instead of responses
marcink -
r3896:8dae2a28 beta
parent child Browse files
Show More
@@ -105,7 +105,11 b' def main(argv=None):'
105 if args.format == FORMAT_PRETTY:
105 if args.format == FORMAT_PRETTY:
106 print 'Calling method %s => %s' % (method, apihost)
106 print 'Calling method %s => %s' % (method, apihost)
107
107
108 json_data = api_call(apikey, apihost, method, **margs)['result']
108 json_resp = api_call(apikey, apihost, method, **margs)
109 if json_resp['error']:
110 json_data = json_resp['error']
111 else:
112 json_data = json_resp['result']
109 if args.format == FORMAT_JSON:
113 if args.format == FORMAT_JSON:
110 print json.dumps(json_data)
114 print json.dumps(json_data)
111 elif args.format == FORMAT_PRETTY:
115 elif args.format == FORMAT_PRETTY:
General Comments 0
You need to be logged in to leave comments. Login now