return network changes

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-25 07:06:22 -05:00
parent a3cffbf1c0
commit da2a24c549
1 changed files with 6 additions and 6 deletions

View File

@ -157,12 +157,12 @@ func updateDroplet(d *DropletT, domcfg *libvirtxml.Domain) error {
return errors.New("not kvm")
}
e, err = updateNetwork(d, domcfg)
nete, err := updateNetwork(d, domcfg)
if err != nil {
log.Info("updateNetwork() failed", err)
return errors.New("updateNetwork() failed")
}
if e != nil {
for _, e := range nete {
alle = append(alle, e)
}
@ -217,8 +217,8 @@ func updateMemory(d *DropletT, domcfg *libvirtxml.Domain) (*pb.Event, error) {
return e, nil
}
func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) (*pb.Event, error) {
var newEvent *pb.Event
func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) ([]*pb.Event, error) {
var allEvents []*pb.Event
if (d == nil) || (domcfg == nil) {
return nil, errors.New("domcfg == nil")
}
@ -285,12 +285,12 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) (*pb.Event, error) {
}
eth.Name = brname
d.pb.Networks = append(d.pb.Networks, eth)
newEvent = NewChangeEvent(d.pb, "Droplet NewNetwork", "", mac+" "+brname)
allEvents = append(allEvents, NewChangeEvent(d.pb, "Droplet NewNetwork", "", mac+" "+brname))
}
}
log.Verbose("mac addrs:", macs)
return newEvent, nil
return allEvents, nil
}
/* from vm3-with-nvme-1.5GB-sec.xml