Read the seat mesh-placement's state through the sdk's PlacementsOf, and write the test mesh's placement as the seat does, one key per module and node (issue 774, research 072 row 37)

This commit is contained in:
2026-10-31 09:29:32 +01:00
parent 747bfa71aa
commit 35a7ff70fe
4 changed files with 17 additions and 13 deletions
+6 -7
View File
@@ -398,14 +398,13 @@ func recordsOn(conn *bus.Conn) (recorded []recordedModule, machines []string, wh
}
machines = delivery.MachineNames(placements)
on := map[string][]string{}
// The placement's keys in either form, a node key and its module keys or the form before (research 072 row 37).
assembled, err := delivery.PlacementsOf(placements)
if err != nil {
why = append(why, delivery.PlacementRead+" (not every key is a placement: "+err.Error()+")")
}
for _, node := range machines {
key, _ := delivery.PlacementKey(node)
var p delivery.Placement
if json.Unmarshal(placements[key], &p) != nil {
why = append(why, delivery.PlacementRead+" ("+key+" is not a placement)")
continue
}
for _, m := range p.Modules {
for _, m := range assembled[node].Modules {
on[m.Module] = append(on[m.Module], node)
}
}