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):
r_str += "<td %s>%s</td>" % (bgcolor, f)
elif f == 'PCU':
if len(vals['plcnode']['pcu_ids']) > 0:
- url = "<a href='http://dendrite.cs.princeton.edu/~soltesz/printbadpcus.php#id%s'>PCU</a>" % vals['plcnode']['pcu_ids'][0]
+ url = "<a href='/cgi-bin/printbadpcus.php#id%s'>PCU</a>" % vals['plcnode']['pcu_ids'][0]
r_str += "<td nowrap %s>%s</td>" % (bgcolor, url)
else:
r_str += "<td nowrap %s>%s</td>" % (bgcolor, f)
# 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 = {}
'status' in vals['plcsite'] and \
vals['plcsite']['status'] == "SUCCESS":
- url = "<a href='printbad.cgi?site=%s'>%s</a>" % ( vals['plcsite']['login_base'],
+ url = "<a href='printbadnodes.py?site=%s'>%s</a>" % ( vals['plcsite']['login_base'],
vals['plcsite']['login_base'])
site_string = "%s %2s nodes :: %2s of %4s slices" % ( \
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)
print "</tr>"
print "</table>"
-import cgi
-import cgitb;
-cgitb.enable()
-import sys
-form = cgi.FieldStorage()
-myfilter = None
-if form.has_key('site'):
- myfilter = form.getvalue("site")
-else:
- myfilter = None
+if __name__ == '__main__':
+ import cgi
+ import cgitb;
+ cgitb.enable()
+ import sys
+ form = cgi.FieldStorage()
+ myfilter = None
-if __name__ == '__main__':
+ if form.has_key('site'):
+ myfilter = form.getvalue("site")
+ else:
+ myfilter = None
parser = OptionParser()
parser.set_defaults(cmpdays=False,
comon="sshstatus",