Exemplo n.º 1
0
func getHV(hn string, e *etcd.Client, c *ln.Context) *ln.Hypervisor {
	var err error
	hn, err = ln.SetHypervisorID(hn)
	if err != nil {
		log.WithFields(log.Fields{
			"error": err,
			"func":  "lochness.SetHypervisorID",
		}).Fatal("failed")
	}

	log.WithField("hypervisor_id", hn).Info("using id")

	hv, err := c.Hypervisor(hn)
	if err != nil {
		log.WithFields(log.Fields{
			"error": err,
			"func":  "context.Hypervisor",
		}).Fatal("failed to fetch hypervisor info")
	}
	return hv
}