cleaning up debgging for import
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
3562fc780e
commit
efc3032d83
38
poll.go
38
poll.go
|
@ -33,40 +33,28 @@ func (h *HyperT) pollHypervisor() {
|
||||||
}
|
}
|
||||||
state := fields[0]
|
state := fields[0]
|
||||||
name := fields[1]
|
name := fields[1]
|
||||||
if state == "OFF" {
|
start := fmt.Sprintf("%-9s %-20s", h.pb.Hostname, name)
|
||||||
d := me.cluster.FindDropletByName(name)
|
d := me.cluster.FindDropletByName(name)
|
||||||
if d == nil {
|
if d == nil {
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "locally defined domain")
|
log.Log(WARN, start, "local defined domain")
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()")
|
log.Log(WARN, start, "local Running AddDropletLocal()")
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()")
|
log.Log(WARN, start, "local Running AddDropletLocal()")
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "Running AddDropletLocal()")
|
log.Log(WARN, start, "local Running AddDropletLocal()")
|
||||||
me.cluster.AddDropletLocal(name, h.pb.Hostname)
|
me.cluster.AddDropletLocal(name, h.pb.Hostname)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
h.lastDroplets[name] = time.Now()
|
||||||
|
if state == "OFF" {
|
||||||
if d.LocalOnly == "" {
|
if d.LocalOnly == "" {
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "duplicate defined (need to resolve this)")
|
log.Log(WARN, start, "local duplicate defined (need to resolve this)")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
log.Log(WARN, "local", h.pb.Hostname, name, "ready to import from hypervisor")
|
log.Log(WARN, start, "local ready to import from hypervisor")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
h.lastDroplets[name] = time.Now()
|
|
||||||
// if _, ok := h.lastDroplets[name]; ok {
|
|
||||||
// h.lastDroplets[name] = time.Now()
|
|
||||||
// }
|
|
||||||
|
|
||||||
// try the protobuf
|
|
||||||
d := me.cluster.FindDropletByName(name)
|
|
||||||
if d == nil {
|
|
||||||
// not sure whawt now?
|
|
||||||
log.Log(WARN, name, "is unknown on", h.pb.Hostname, "state =", state)
|
|
||||||
log.Log(WARN, name, "this vm was probably started by hand using virtsh")
|
|
||||||
log.Log(WARN, name, "todo: import vm from libvrit")
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if state == "ON" {
|
if state == "ON" {
|
||||||
log.Log(POLL, h.pb.Hostname, "STATE:", state, "HOST:", name, "rest:", fields[2:])
|
log.Log(POLL, start, "STATE:", state, "rest:", fields[2:])
|
||||||
log.Log(INFO, "ALREADY RECORDED", d.Hostname)
|
|
||||||
|
|
||||||
// update the status to ON
|
// update the status to ON
|
||||||
d.Current.State = pb.DropletState_ON
|
d.Current.State = pb.DropletState_ON
|
||||||
|
@ -81,12 +69,12 @@ func (h *HyperT) pollHypervisor() {
|
||||||
|
|
||||||
// this should mean a droplet is running where the config file says it probably should be running
|
// this should mean a droplet is running where the config file says it probably should be running
|
||||||
if d.PreferredHypervisor == h.pb.Hostname {
|
if d.PreferredHypervisor == h.pb.Hostname {
|
||||||
log.Log(EVENT, "poll shows new droplet", d.Hostname, "(matches config hypervisor", h.pb.Hostname+")")
|
log.Log(EVENT, start, "poll shows new droplet", d.Hostname, "(matches config hypervisor", h.pb.Hostname+")")
|
||||||
d.Current.Hypervisor = h.pb.Hostname
|
d.Current.Hypervisor = h.pb.Hostname
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Log(EVENT, "poll shows new droplet", d.Hostname, "on", h.pb.Hostname, "(in config file without preferred hypervisor)")
|
log.Log(EVENT, start, "poll shows new droplet (in config file without preferred hypervisor)")
|
||||||
d.Current.Hypervisor = h.pb.Hostname
|
d.Current.Hypervisor = h.pb.Hostname
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue