Browse Source

Merge branch 'rollout-status' into 'master'

!rollout-status list <version>: always count inactive nodes
Helge Jung 8 years ago
parent
commit
8374fc30e0
1 changed files with 13 additions and 8 deletions
  1. 13 8
      modules/ffpb_netstatus.py

+ 13 - 8
modules/ffpb_netstatus.py

@@ -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,