- 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=fbsync.round,
+ plc_pcuid=pcu_id,
+ plc_pcu_stats=values['plc_pcu_stats'],
+ dns_status=values['dnsmatch'],
+ port_status=values['portstatus'],
+ entry_complete=" ".join(values['complete_entry']),
+ reboot_trial_status="%s" % values['reboot'],
+ )
+ fbnodesync.round = global_round
+
+ fbnodesync.flush()
+ fbsync.flush()
+ fbrec.flush()