import sys
import yaml
from pathlib import Path
+from _datetime import timezone
def sendVesEvent(data):
url = data['config']['vesEndpoint']['url']
# catastrophic error. bail.
raise SystemExit(e)
- if response.status_code >= 200 and response.status_code < 300:
+ if response.status_code >= 200 and response.status_code <= 500:
print(response)
else:
sys.exit('Reading VES "stndDefined" message template failed.')
sys.exit('Reading VES "stndDefined" message template failed.')
def getInitData(domain, stndBody=''):
- currentTime = datetime.datetime.utcnow()
+ currentTime = datetime.datetime.now(tz=timezone.utc)
dir = os.path.dirname(os.path.realpath(__file__))
result = {}
with open(outputFileName, 'w') as f:
json.dump(data['body'], f, indent=2, sort_keys=True)
else:
- print("Example could not been saved:\n" + json.dump(data, f, indent=2, sort_keys=True))
-
\ No newline at end of file
+ print("Example could not been saved:\n" + json.dump(data, f, indent=2, sort_keys=True))