dumb nil panic

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-25 15:56:40 -05:00
parent b6dd67b73d
commit cf79357bba
1 changed files with 12 additions and 11 deletions

View File

@ -263,18 +263,19 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) ([]*pb.Event, error)
return nil, errors.New("bridge is nil and no mac address")
}
brname = ""
}
if iface.Source.Bridge.Bridge == "" {
if hwaddr == "" {
fmt.Printf("non-standard network: %+v\n", iface)
fmt.Printf("iface.Mac: %+v\n", iface)
updatedXML, _ := xml.MarshalIndent(domcfg.Devices.Interfaces, "", " ")
log.Info("Non-Standard Network XML Start")
fmt.Println(string(updatedXML))
log.Info("Non-Standard Network XML End")
return nil, errors.New("bridge is blank and no mac address")
} else {
if iface.Source.Bridge.Bridge == "" {
if hwaddr == "" {
fmt.Printf("non-standard network: %+v\n", iface)
fmt.Printf("iface.Mac: %+v\n", iface)
updatedXML, _ := xml.MarshalIndent(domcfg.Devices.Interfaces, "", " ")
log.Info("Non-Standard Network XML Start")
fmt.Println(string(updatedXML))
log.Info("Non-Standard Network XML End")
return nil, errors.New("bridge is blank and no mac address")
}
brname = iface.Source.Bridge.Bridge
}
brname = iface.Source.Bridge.Bridge
}
// log.Info("network has bridge:", iface.Source.Bridge.Bridge)
if hwaddr == "" {