Skip to content

Commit

Permalink
Fix for gpmidi#10 and gpmidi#9
Browse files Browse the repository at this point in the history
I'm no python guy so please review.

gpmidi#9: gpmidi#9
gpmidi#10: gpmidi#10

Apache server-status that outputs the TLSSessionCacheStatus section breaks the csv reader since that line contains no ":". 

I've added a breakout condition to end parsing the server-status after the Scorebaord status.
  • Loading branch information
ericrisler authored Feb 27, 2017
1 parent 6891c19 commit ae6f7ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/check_apache
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,11 @@ def parse(data, version):
replace = '() '
csvobj = csv.reader(StringIO.StringIO(data), delimiter = ":", skipinitialspace = True)
ret = {}
breakout = False
for (key, val) in csvobj:
if key == 'Scoreboard':
# end processing at Scorboard key
breakout = True
sb = {
"Waiting for Connection":0,
"Starting up":0,
Expand All @@ -169,6 +172,8 @@ def parse(data, version):
ret[key] = sb
else:
ret[key] = val
if breakout == True:
break
ret2 = {}
for (key, val) in ret.items():
if key == "Scoreboard":
Expand Down

0 comments on commit ae6f7ce

Please sign in to comment.