added some minor status message at the end
[monitor.git] / www / printbadnodes.py
index ea355fe..2f86db7 100755 (executable)
@@ -63,7 +63,7 @@ def cmpState(l1, l2):
        return cmpMap(l1,l2,'state', map)
 
 def cmpCategoryVal(v1, v2):
-       map = array_to_priority_map([ None, 'ALPHA', 'PROD', 'OLDBOOTCD', 'UNKNOWN', 'ERROR', ])
+       map = array_to_priority_map([ None, 'ALPHA', 'PROD', 'OLDBOOTCD', 'UNKNOWN', 'FORCED', 'ERROR', ])
        return cmpValMap(v1,v2,map)
 
 def cmpCategory(l1, l2):
@@ -258,6 +258,11 @@ def main(sitefilter):
        # d2 was an array of [{node}, {}, ...]
        # the bysite is a loginbase dict of [{node}, {node}]
        d2 = []
+       import re
+       if sitefilter != None:
+               sf = re.compile(sitefilter)
+       else:
+               sf = None
        for nodename in l_nodes: 
                vals=d_n[nodename]['values'] 
                v = {}
@@ -283,7 +288,7 @@ def main(sitefilter):
 
                v['site_string'] = site_string
                v['loginbase'] = loginbase
-               if (sitefilter != None and loginbase == sitefilter) or sitefilter == None:
+               if (sitefilter != None and sf.match(loginbase) != None) or sitefilter == None:
                        d2.append(v)