- try:
- http_code, resp = self._http.post_cmd(endpoint='/test/message/metric_request',
- postfields_dict=data)
- #print 'HTTP CODE: {}'.format(http_code)
- #print 'RESP: {}'.format(resp)
- if http_code in (200, 201, 202, 204):
- #resp = json.loads(resp)
- return 'Metric exported'
- else:
- msg = ""
- if resp:
- try:
- msg = json.loads(resp)
- except ValueError:
- msg = resp
- raise ClientException('error: code: {}, resp: {}'.format(
- http_code, msg))
- except ClientException as exc:
- message="failed to export metric: metric {}\n{}".format(
- metric,
- exc.message)
- raise ClientException(message)
+ #try:
+ http_code, resp = self._http.post_cmd(endpoint='/test/message/metric_request',
+ postfields_dict=data)
+ #print('HTTP CODE: {}'.format(http_code))
+ #print('RESP: {}'.format(resp))
+ #if http_code in (200, 201, 202, 204):
+ #resp = json.loads(resp)
+ return 'Metric exported'
+ #else:
+ # msg = ""
+ # if resp:
+ # try:
+ # msg = json.loads(resp)
+ # except ValueError:
+ # msg = resp
+ # raise ClientException('error: code: {}, resp: {}'.format(
+ # http_code, msg))
+ #except ClientException as exc:
+ # message="failed to export metric: metric {}\n{}".format(
+ # metric,
+ # str(exc))
+ # raise ClientException(message)