Exemplo n.º 1
0
func (i *Chef) Delete(assembly *global.AssemblyWithComponents, id string) (string, error) {
	// Iaas Provider
	provider := "megam"

	log.Info(provider)
	iaas, pdc, err1 := iaas.GetIaasProvider(provider)
	if err1 != nil {
		log.Error("Error: Iaas Provider :\n%s.", err1)
		return "", err1
	}
	log.Info(iaas)
	str, iaaserr := iaas.DeleteMachine(pdc, assembly)
	if iaaserr != nil {
		log.Error("Error: Iaas Provider doesn't delete machine:\n%s.", iaaserr)
		return "", iaaserr
	}
	log.Info(str)
	return str, nil
}
Exemplo n.º 2
0
func (i *Chef) Create(assembly *global.AssemblyWithComponents, id string, instance bool, act_id string) (string, error) {
	// Iaas Provider
	provider := ""
	log.Info("Chef provisioner entry")
	if instance {
		provider = "megam"
	} else {
		// this is hack for only 0.8 release and future we implements hybrid cloud
		provider = "megam"
	}

	log.Info(provider)
	iaas, pdc, err1 := iaas.GetIaasProvider(provider)
	if err1 != nil {
		log.Error("Error: Iaas Provider :\n%s.", err1)
		return "", err1
	}
	str, iaaserr := iaas.CreateMachine(pdc, assembly, act_id)
	if iaaserr != nil {
		log.Error("Error: Iaas Provider doesn't create machine:\n%s.", iaaserr)
		return "", iaaserr
	}
	return str, nil
}