Merge "Issue #2660 Improved error logging in GetBrokerConnections.py" into omaha_14.2.1
Former-commit-id: 7b07fb752c193bb2617fda5921116182fcd86379
This commit is contained in:
commit
055540bcff
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