From 31faad73568712e9e77cfbd0bf50f3b7cc2ede00 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 22 May 2024 07:28:07 +0200 Subject: Make stats output JSON-compatible JSON is a subset of YAML, so YAML parsers still work --- example_stats_receiver.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'example_stats_receiver.py') diff --git a/example_stats_receiver.py b/example_stats_receiver.py index a48f560..9c9750c 100755 --- a/example_stats_receiver.py +++ b/example_stats_receiver.py @@ -7,7 +7,7 @@ import os import os.path import socket import argparse -import yaml +import json parser = argparse.ArgumentParser( description="Example Stats UNIX Datagram Socket Receiver") @@ -34,5 +34,5 @@ while True: data, addr = sock.recvfrom(256) logging.info("RX from {}". format(addr)) - data = yaml.safe_load(data) + data = json.loads(data) print(data) -- cgit v1.2.3