ensure that an empty listener stats dict is not sent to the server

This commit is contained in:
Martin Konecny 2013-04-05 13:56:41 -04:00
parent 266823b1d9
commit cdb53048c7
1 changed files with 3 additions and 2 deletions

View File

@ -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')