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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user