Skip to content

Commit

Permalink
Update datacore_get_perf.py
Browse files Browse the repository at this point in the history
Manage Rest ErrorCode (catch with try)
  • Loading branch information
lblanc authored Jul 7, 2020
1 parent 822b480 commit a0855d0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions datacore/datacore_get_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ def dcs_get_object(dcs_object):
else:
logging.info("Querying {}".format(dcs_object))
tmp = r.json()
if tmp["ErrorCode"]:
result = []
try:
err = tmp["ErrorCode"]
except:
logging.info("No Rest ErrorCode")
else:
logging.error(tmp["Message"])
sys.exit(1)
result = []
if dcs_object == "servers":
for item in tmp:
test = str(item["RegionNodeId"])
Expand Down

0 comments on commit a0855d0

Please sign in to comment.