Issue #2660 Improved error logging in GetBrokerConnections.py
Change-Id: Icf39a847106c13785e16aaef12283f44f4791cd1 Former-commit-id:2db1ae7b2d
[formerlyf47313690a
[formerly b078a4fa3dc8df69903fa07e172b5de6313bb17a]] Former-commit-id:f47313690a
Former-commit-id:8531b21576
This commit is contained in:
parent
fe81181bf1
commit
76c4f81485
1 changed files with 3 additions and 1 deletions
|
@ -26,6 +26,7 @@
|
|||
# Date Ticket# Engineer Description
|
||||
# ------------ ---------- ----------- --------------------------
|
||||
# 03/21/13 1814 rjpeter Updated to use rest API for java broker
|
||||
# 01/15/14 2660 randerso Log status and reason if request fails
|
||||
##
|
||||
import httplib
|
||||
import json
|
||||
|
@ -45,7 +46,8 @@ def getConnections(brokerHost, port=8180):
|
|||
response = httpConn.getresponse()
|
||||
|
||||
if (response.status != 200):
|
||||
raise Exception("Unable to post request to server")
|
||||
msg = "Broker %s returned %d %s" % (brokerHost, response.status, response.reason)
|
||||
raise Exception(msg)
|
||||
|
||||
jsonStr = response.read()
|
||||
jsonObjArray = json.loads(jsonStr)
|
||||
|
|
Loading…
Add table
Reference in a new issue