parent
3c520003ed
commit
b4ef8b76b1
14
http.go
14
http.go
|
@ -57,19 +57,19 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if route == "/create" {
|
||||
log.Info("virtigo create starts here")
|
||||
fmt.Fprintln(w, "virtigo create starts here")
|
||||
if route == "/import" {
|
||||
log.Info("virtigo import starts here")
|
||||
fmt.Fprintln(w, "virtigo import starts here")
|
||||
result, err := create(w, r)
|
||||
if err != nil {
|
||||
log.Info("virtigo create failed")
|
||||
log.Info("virtigo import failed")
|
||||
log.Info(result)
|
||||
fmt.Fprintln(w, "virtigo create failed")
|
||||
fmt.Fprintln(w, "virtigo import failed")
|
||||
fmt.Fprintln(w, result)
|
||||
return
|
||||
}
|
||||
log.Info("virtigo create ends here")
|
||||
fmt.Fprintln(w, "virtigo create ends here")
|
||||
log.Info("virtigo import ends here")
|
||||
fmt.Fprintln(w, "virtigo import ends here")
|
||||
return
|
||||
}
|
||||
|
||||
|
|
9
poll.go
9
poll.go
|
@ -28,13 +28,18 @@ func (h *HyperT) pollHypervisor() {
|
|||
}
|
||||
fields := strings.Fields(line)
|
||||
if len(fields) < 2 {
|
||||
log.Log(WARN, "locally defined:", h.pb.Hostname, fields)
|
||||
log.Log(WARN, "unknown:", h.pb.Hostname, fields)
|
||||
continue
|
||||
}
|
||||
state := fields[0]
|
||||
name := fields[1]
|
||||
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
|
||||
continue
|
||||
}
|
||||
|
|
11
validate.go
11
validate.go
|
@ -223,7 +223,14 @@ func ValidateDroplets() (map[string]string, map[string]string, error) {
|
|||
// UUID already exists
|
||||
log.Info("duplicate UUID", d.Uuid, umap[d.Uuid])
|
||||
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
|
||||
|
||||
|
@ -288,7 +295,7 @@ func ValidateDroplet(check *pb.Droplet) error {
|
|||
os.Exit(-1)
|
||||
}
|
||||
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