diff options
| author | Jeff Carr <[email protected]> | 2024-10-26 10:34:26 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-26 10:34:26 -0500 |
| commit | 5406da8e753beb6c62621c3f98d819afab09c28b (patch) | |
| tree | 60fc6df814237e4916bd8b4bb888ca4858b488cf | |
| parent | 636068c5b790564915f59960c1a6ceebe877c978 (diff) | |
kinda works
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | start.go | 10 | ||||
| -rw-r--r-- | validate.go | 1 |
2 files changed, 9 insertions, 2 deletions
@@ -14,7 +14,7 @@ import ( ) // generate the XML for 'virsh create' -func StartDropletXml(d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) { +func StartDropletXml(cluster *pb.Cluster, d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) { /* if d == nil { log.Info("droplet is nil") @@ -70,8 +70,14 @@ func StartDropletXml(d *pb.Droplet, domcfg *libvirtxml.Domain, hostname string) // 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") + } + log.Info("Should look in cluster dirs:", cluster.Dirs) for _, disk := range d.Disks { - fullname := findDisk([]string{"/home/nfs2", "/var/lib/libvirt/images"}, disk.Filename) + fullname := findDisk(cluster.Dirs, disk.Filename) if fullname == "" { log.Info("can not find disk", d.Hostname, "dir", disk.Filepath, "filename", disk.Filename) os.Exit(-1) diff --git a/validate.go b/validate.go index bfac46a..f64df1b 100644 --- a/validate.go +++ b/validate.go @@ -167,6 +167,7 @@ func CheckDiskFilenames(cluster *pb.Cluster) []*pb.Event { return alle } +// this doesn't run often func CheckDroplets(cluster *pb.Cluster, dump bool) bool { // uuid map to check for duplicates var umap map[string]string |
