- global_round = externalState['round']
- pcu_id = "id_%s" % nodename
- externalState['nodes'][pcu_id]['values'] = values
- externalState['nodes'][pcu_id]['round'] = global_round
+ pcu_id = int(nodename)
+ #fbsync = FindbadPCURecordSync.findby_or_create(plc_pcuid=0,
+ # if_new_set={'round': global_round})
+ #global_round = fbsync.round
+ fbnodesync = FindbadPCURecordSync.findby_or_create(plc_pcuid=pcu_id,
+ if_new_set={'round' : global_round})
+
+ fbrec = FindbadPCURecord(
+ date_checked=datetime.fromtimestamp(values['date_checked']),
+ round=global_round,
+ plc_pcuid=pcu_id,
+ plc_pcu_stats=values['plc_pcu_stats'],
+ dns_status=values['dns_status'],
+ port_status=values['port_status'],
+ entry_complete=" ".join(values['entry_complete']),
+ reboot_trial_status="%s" % values['reboot'],
+ )
+ fbnodesync.round = global_round
+
+ fbnodesync.flush()
+ #fbsync.flush()
+ fbrec.flush()