fix empty string player regex
This commit is contained in:
parent
aa55190637
commit
74d57fc124
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ class MinecraftCollector(object):
|
||||||
playerregex = re.compile("players online:(.*)")
|
playerregex = re.compile("players online:(.*)")
|
||||||
if playerregex.findall(resp):
|
if playerregex.findall(resp):
|
||||||
for player in playerregex.findall(resp)[0].split(","):
|
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()})
|
player_online.add_sample('player_online',value=1,labels={'player':player.lstrip()})
|
||||||
|
|
||||||
return metrics
|
return metrics
|
||||||
|
|
Loading…
Reference in a new issue