From 69a8b35a1497b893283a729eeeca75ee66b5720e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 26 Oct 2024 20:54:46 -0500 Subject: [PATCH] seems to work Signed-off-by: Jeff Carr --- start.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/start.go b/start.go index 104902c..c8a8b23 100644 --- a/start.go +++ b/start.go @@ -14,7 +14,7 @@ import ( ) // generate the XML for 'virsh create' -func GenerateDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error { +func GenerateDropletXml(dirs []string, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) error { /* if d == nil { log.Info("droplet is nil") @@ -70,14 +70,14 @@ func GenerateDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.D // add a check here to make these unique // setRandomMacs(domcfg) - if len(cluster.Dirs) == 0 { - log.Info("ERROR: cluster dirs was empty. adding default location.") - log.Info("add paths to search for in ~/.config/virtigo/cluster.text") - cluster.Dirs = append(cluster.Dirs, "/var/libvirt/images") + if len(dirs) == 0 { + dirs = append(dirs, "/home/nfs2") + dirs = append(dirs, "/home/nfs3") + dirs = append(dirs, "/var/lib/libvirt/images") } - log.Info("Should look in cluster dirs:", cluster.Dirs) + log.Info("Should look in dirs:", dirs) for _, disk := range d.Disks { - fullname := findDisk(cluster.Dirs, disk.Filename) + fullname := findDisk(dirs, disk.Filename) if fullname == "" { log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename) os.Exit(-1)