fix empty string player regex

This commit is contained in:
Joshua Grimm 2020-05-11 21:57:03 +02:00
parent aa55190637
commit 74d57fc124

View file

@ -109,7 +109,7 @@ class MinecraftCollector(object):
playerregex = re.compile("players online:(.*)")
if playerregex.findall(resp):
for player in playerregex.findall(resp)[0].split(","):
if player:
if player and player != "":
player_online.add_sample('player_online',value=1,labels={'player':player.lstrip()})
return metrics