6 import parser as parsermodule
8 def nodes_from_time(time_str):
10 archive = database.SPickle(path)
11 d = datetime_fromstr(config.fromtime)
12 glob_str = "%s*.production.findbad.pkl" % d.strftime("%Y-%m-%d")
15 file = glob.glob(glob_str)[0]
16 #print "loading %s" % file
18 fb = archive.load(file[:-4])
20 nodelist = fb['nodes'].keys()
21 nodelist = node_select(config.select, nodelist, fb)
25 parser = parsermodule.getParser()
26 parser.set_defaults(nodeselect=None,)
27 parser.add_option("", "--nodeselect", dest="nodeselect", metavar="state=BOOT",
28 help="""Query on the nodes to count""")
30 parser = parsermodule.getParser(['defaults'], parser)
31 cfg = parsermodule.parse_args(parser)
33 time1 = config.args[0]
34 time2 = config.args[1]
36 s1 = nodes_from_time(time1)
37 s2 = nodes_from_time(time2)
39 # takes two arguments as dates, comparing the number of up nodes from one and