zones: allow iterators to terminate

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-22 20:11:41 +00:00
parent 589fb2f0e1
commit f7da9519fa
2 changed files with 13 additions and 8 deletions
+3 -4
View File
@@ -31,10 +31,9 @@ func (m *Zones) scan() error {
func (m *Zones) scanMachines() error {
var err error
m.ForEachMachine(func(p *Machine) {
if err == nil {
err = p.scan()
}
m.ForEachMachine(func(p *Machine) bool {
err = p.scan()
return err != nil
})
return err
}