- fbrec = FindbadNodeRecord(
- date_checked=datetime.fromtimestamp(values['date_checked']),
- hostname=nodename,
- loginbase=values['loginbase'],
- kernel_version=values['kernel'],
- bootcd_version=values['bootcd'],
- nm_status=values['nm'],
- fs_status=values['readonlyfs'],
- dns_status=values['dns'],
- princeton_comon_dir=values['princeton_comon'],
- princeton_comon_running=values['princeton_comon_running'],
- princeton_comon_procs=values['princeton_comon_procs'],
- plc_node_stats = values['plcnode'],
- plc_site_stats = values['plcsite'],
- plc_pcuid = values['pcu'],
- comon_stats = values['comonstats'],
- ping_status = (values['ping'] == "PING"),
- ssh_portused = values['sshport'],
- ssh_status = (values['ssh'] == "SSH"),
- ssh_error = values['ssherror'],
- observed_status = values['state'],
- )
+ # NOTE: This code will either add a new record for the new global_round,
+ # OR it will find the previous value, and update it
+ # with new information.
+ # The data that is 'lost' is not that important, b/c older
+ # history still exists.
+ fbrec = FindbadNodeRecord.findby_or_create(
+ round=global_round,
+ hostname=nodename)
+
+ fbrec.set( **values )
+ #date_checked=values['date_checked'],
+ #loginbase=values['loginbase'],
+ #kernel_version=values['kernel_version'],
+ #bootcd_version=values['bootcd_version'],
+ #nm_status=values['nm_status'],
+ #fs_status=values['fs_status'],
+ #dns_status=values['dns_status'],
+ #princeton_comon_dir=values['princeton_comon_dir'],
+ #princeton_comon_running=values['princeton_comon_running'],
+ #princeton_comon_procs=values['princeton_comon_procs'],
+ #plc_node_stats = values['plc_node_stats'],
+ #plc_site_stats = values['plc_site_stats'],
+ #plc_pcuid = values['plc_pcuid'],
+ #comon_stats = values['comon_stats'],
+ #ping_status = values['ping_status'],
+ #ssh_portused = values['ssh_portused'],
+ #ssh_status = values['ssh_status'],
+ #ssh_error = values['ssh_error'],
+ #observed_status = values['observed_status'],
+ #observed_category = values['observed_category'])
+
+ #for v in before.keys():
+ # if before[v] == after[v]:
+ # print "SAME FOR KEY %s" % v
+ # print "%s : %s\t%s" % ( v, before[v], after[v] )
+
+ fbrec.flush()