From cdb53048c7007ff09c30edb89c8a0831cc5e9578 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 5 Apr 2013 13:56:41 -0400 Subject: [PATCH] ensure that an empty listener stats dict is not sent to the server --- python_apps/pypo/listenerstat.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python_apps/pypo/listenerstat.py b/python_apps/pypo/listenerstat.py index 1a7bb27b1..0bb06357b 100644 --- a/python_apps/pypo/listenerstat.py +++ b/python_apps/pypo/listenerstat.py @@ -51,7 +51,7 @@ class ListenerStat(Thread): dom = xml.dom.minidom.parseString(document) sources = dom.getElementsByTagName("source") - mount_stats = {} + mount_stats = None for s in sources: #drop the leading '/' character mount_name = s.getAttribute("mount")[1:] @@ -97,7 +97,8 @@ class ListenerStat(Thread): if v["enable"] == 'true': try: if v["output"] == "icecast": - stats.append(self.get_icecast_stats(v)) + mount_stats = self.get_icecast_stats(v) + if mount_stats: stats.append(mount_stats) else: stats.append(self.get_shoutcast_stats(v)) self.update_listener_stat_error(v["mount"], 'OK')