seems to work

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-26 20:54:46 -05:00
parent a2190048af
commit 69a8b35a14
1 changed files with 7 additions and 7 deletions

View File

@ -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)