parent
3c520003ed
commit
b4ef8b76b1
14
http.go
14
http.go
|
@ -57,19 +57,19 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if route == "/create" {
|
if route == "/import" {
|
||||||
log.Info("virtigo create starts here")
|
log.Info("virtigo import starts here")
|
||||||
fmt.Fprintln(w, "virtigo create starts here")
|
fmt.Fprintln(w, "virtigo import starts here")
|
||||||
result, err := create(w, r)
|
result, err := create(w, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("virtigo create failed")
|
log.Info("virtigo import failed")
|
||||||
log.Info(result)
|
log.Info(result)
|
||||||
fmt.Fprintln(w, "virtigo create failed")
|
fmt.Fprintln(w, "virtigo import failed")
|
||||||
fmt.Fprintln(w, result)
|
fmt.Fprintln(w, result)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("virtigo create ends here")
|
log.Info("virtigo import ends here")
|
||||||
fmt.Fprintln(w, "virtigo create ends here")
|
fmt.Fprintln(w, "virtigo import ends here")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
9
poll.go
9
poll.go
|
@ -28,13 +28,18 @@ func (h *HyperT) pollHypervisor() {
|
||||||
}
|
}
|
||||||
fields := strings.Fields(line)
|
fields := strings.Fields(line)
|
||||||
if len(fields) < 2 {
|
if len(fields) < 2 {
|
||||||
log.Log(WARN, "locally defined:", h.pb.Hostname, fields)
|
log.Log(WARN, "unknown:", h.pb.Hostname, fields)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
state := fields[0]
|
state := fields[0]
|
||||||
name := fields[1]
|
name := fields[1]
|
||||||
if state == "OFF" {
|
if state == "OFF" {
|
||||||
log.Log(WARN, "locally defined:", h.pb.Hostname, fields)
|
d := me.cluster.FindDropletByName(name)
|
||||||
|
if d == nil {
|
||||||
|
log.Log(WARN, "locally defined:", h.pb.Hostname, fields, "not imported")
|
||||||
|
} else {
|
||||||
|
log.Log(WARN, "locally defined:", h.pb.Hostname, fields, d.Hostname)
|
||||||
|
}
|
||||||
// skip locally defined libvirt vms
|
// skip locally defined libvirt vms
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
11
validate.go
11
validate.go
|
@ -223,7 +223,14 @@ func ValidateDroplets() (map[string]string, map[string]string, error) {
|
||||||
// UUID already exists
|
// UUID already exists
|
||||||
log.Info("duplicate UUID", d.Uuid, umap[d.Uuid])
|
log.Info("duplicate UUID", d.Uuid, umap[d.Uuid])
|
||||||
log.Info("duplicate UUID", d.Uuid, d.Hostname)
|
log.Info("duplicate UUID", d.Uuid, d.Hostname)
|
||||||
return umap, macs, errors.New("duplicate UUID: " + d.Uuid)
|
if d.Archive == nil {
|
||||||
|
d.Archive = new(pb.Archive)
|
||||||
|
log.Info("d.Archive was nil for", d.Hostname)
|
||||||
|
// os.Exit(-1)
|
||||||
|
}
|
||||||
|
d.Archive.Reason = pb.DropletArchive_DUP
|
||||||
|
continue
|
||||||
|
// return umap, macs, errors.New("duplicate UUID: " + d.Uuid)
|
||||||
}
|
}
|
||||||
umap[d.Uuid] = d.Hostname
|
umap[d.Uuid] = d.Hostname
|
||||||
|
|
||||||
|
@ -288,7 +295,7 @@ func ValidateDroplet(check *pb.Droplet) error {
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
}
|
}
|
||||||
d.Archive.Reason = pb.DropletArchive_DUP
|
d.Archive.Reason = pb.DropletArchive_DUP
|
||||||
return errors.New("duplicate UUID: " + d.Uuid)
|
// return errors.New("duplicate UUID: " + d.Uuid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue