From 3893ac7e3db61ef4425698abe8fceca3f5ca7135 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 25 Oct 2024 20:09:41 -0500 Subject: [PATCH] --xml-ignore-disk=true works Signed-off-by: Jeff Carr --- Makefile | 2 +- addDroplet.go | 4 ---- main.go | 3 +-- validate.go | 8 ++++++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 5c7ec1b..95364fb 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ all: ./virtigo --help xml-add: - ./virtigo --libvirt ~/libvirt/*.xml + ./virtigo --libvirt ~/libvirt/*.xml --xml-ignore-disk=true start-all-droplets: curl --silent http://localhost:8080/start?start=git.wit.org diff --git a/addDroplet.go b/addDroplet.go index 7cd9676..7212ed8 100644 --- a/addDroplet.go +++ b/addDroplet.go @@ -173,12 +173,8 @@ func updateDroplet(d *DropletT, domcfg *libvirtxml.Domain) ([]*pb.Event, error) alle = append(alle, e) } - log.Info("TODO: fix updateDisk() change events") - log.Info("TODO: fix updateDisk() change events") - log.Info("TODO: fix updateDisk() change events") nete, err = updateDisk(d, domcfg) if err != nil { - log.Info("updateDisk() failed", err) return alle, err } diff --git a/main.go b/main.go index df698f8..ec42517 100644 --- a/main.go +++ b/main.go @@ -75,9 +75,8 @@ func main() { } // this is a new droplet. add it to the cluster log.Info("Add XML Droplet here", domcfg.Name) - d, newe, err := addDomainDroplet(domcfg) + _, newe, err := addDomainDroplet(domcfg) if err != nil { - log.Info("addDomainDroplet() error d =", d) log.Info("addDomainDroplet() error", filename) log.Info("addDomainDroplet() error", err) log.Info("libvirt XML will have to be fixed by hand") diff --git a/validate.go b/validate.go index 5791c03..4e0dabe 100644 --- a/validate.go +++ b/validate.go @@ -70,8 +70,12 @@ func insertFilename(d *pb.Droplet, filename string) (*pb.Event, error) { if dupd != nil { log.Info("file", filename, "already on droplet", dupd.Hostname) log.Info("file", filename, "on new droplet", d.Hostname) - log.Info("duplicate disk names (--xml-ignore-disk to ignore)") - return nil, errors.New("duplicate disk names") + if argv.IgnDisk { + log.Info("ignore duplicate disk names (--xml-ignore-disk=true)") + } else { + log.Info("duplicate disk names (--xml-ignore-disk to ignore)") + return nil, errors.New("duplicate disk names") + } } filebase := filepath.Base(filename) dir := filepath.Dir(filename)