From 1bb8c0973ecce68caa869f9af955eabd2d206559 Mon Sep 17 00:00:00 2001 From: demx8as6 Date: Wed, 15 Dec 2021 17:49:37 +0100 Subject: [PATCH] only print status if ok - small correction IssueID: OAM-242 Change-Id: I9977c5901c6b25ad39197f406af44a079f6fb32a Signed-off-by: demx8as6 --- solution/dev/client-scripts-ves-v7/globalVesEventEmitter.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/solution/dev/client-scripts-ves-v7/globalVesEventEmitter.py b/solution/dev/client-scripts-ves-v7/globalVesEventEmitter.py index 9f44a5c..26c3879 100644 --- a/solution/dev/client-scripts-ves-v7/globalVesEventEmitter.py +++ b/solution/dev/client-scripts-ves-v7/globalVesEventEmitter.py @@ -44,11 +44,12 @@ def sendVesEvent(data): except requests.exceptions.RequestException as e: # catastrophic error. bail. raise SystemExit(e) - - if response.status_code >= 200 and response.status_code <= 500: + + if response.status_code >= 200 and response.status_code <= 300: print(response) else: - sys.exit('Reading VES "stndDefined" message template failed.') + print(response.status_code) + sys.exit('Sending VES "stndDefined" message template failed with code %d.' % response.status_code) def sendHttpGet(url): try: @@ -60,7 +61,7 @@ def sendHttpGet(url): except requests.exceptions.RequestException as e: # catastrophic error. bail. raise SystemExit(e) - + if response.status_code >= 200 and response.status_code < 300: return response.json() else: -- 2.16.6