X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=solution%2Fdev%2Fclient-scripts-ves-v7%2FglobalVesEventEmitter.py;h=26c38794b8975d829c85457e48f67f4583e65559;hb=1f44a1e09401212c714c5b43e635f5c6ccf77c94;hp=9f44a5c8eb76aeea39d4a59898dac52af6073881;hpb=ada686d6e3850ddf7a9589997cbdc42ffc817a3b;p=oam.git 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: