Skip to content
Snippets Groups Projects
Commit 95a3e777 authored by Karsten Böddeker's avatar Karsten Böddeker
Browse files

!rollout-status list <version>: always count inactive nodes

This code is untested.
parent 0f79269b
No related branches found
No related tags found
1 merge request!8!rollout-status list <version>: always count inactive nodes
......@@ -174,19 +174,24 @@ def ffpb_rolloutstatus(bot, trigger):
total = sum([len(result[x]) for x in result])
if total == 0:
bot.reply('Niemand benutzt derzeit die Version "{version}".'.format(version=list_nodes))
if list_inactive > 0:
bot.say('Aber es wurden {count} inaktive/offline Knoten mit Version {version} gezählt.'.format(
count=list_inactive,
version=list_nodes,
))
return
if total > MAX_ROLLOUTSTATUS_LIST:
bot.reply('Das betrifft {total} Knoten, mehr als {max} werte ich als IRC-Spam.'.format(total=total, max=MAX_ROLLOUTSTATUS_LIST))
return
else:
for branch, nodes in result.items():
bot.say('{count} Knoten auf {version} "{branch}": {nodes}'.format(
branch=branch,
version=list_nodes,
count=len(nodes),
nodes=','.join(nodes),
))
for branch, nodes in result.items():
bot.say('{count} Knoten auf {version} "{branch}": {nodes}'.format(
branch=branch,
version=list_nodes,
count=len(nodes),
nodes=','.join(nodes),
))
if list_inactive > 0:
bot.say('Zudem wurden {count} inaktive/offline Knoten mit Version {version} gezählt.'.format(
count=list_inactive,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment