dump out xml for networks that don't parse
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
9451e162a0
commit
89a43a46bf
|
@ -3,6 +3,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
|
@ -244,15 +245,27 @@ func updateNetwork(d *DropletT, domcfg *libvirtxml.Domain) ([]*pb.Event, error)
|
|||
hwaddr = iface.MAC.Address
|
||||
}
|
||||
if iface.Source == nil {
|
||||
fmt.Printf("non-standard network: %+v\n", iface)
|
||||
// fmt.Printf("non-standard network: %+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("non-standard network")
|
||||
}
|
||||
|
||||
if iface.Source.Bridge == nil {
|
||||
fmt.Printf("non-standard network: %+v\n", iface)
|
||||
// fmt.Printf("non-standard network: %+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 nil and no mac address")
|
||||
}
|
||||
if iface.Source.Bridge.Bridge == "" {
|
||||
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")
|
||||
}
|
||||
// log.Info("network has bridge:", iface.Source.Bridge.Bridge)
|
||||
|
|
Loading…
Reference in New Issue