parent
2ab607246e
commit
168061377b
|
@ -14,7 +14,7 @@ import (
|
|||
)
|
||||
|
||||
// import a libvirt xml file
|
||||
func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
|
||||
func AddDomainDroplet(cluster *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, []*pb.Event, error) {
|
||||
var alle []*pb.Event
|
||||
if domcfg == nil {
|
||||
return nil, alle, errors.New("domcfg == nil")
|
||||
|
@ -46,13 +46,15 @@ func AddDomainDroplet(cluster *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Dropl
|
|||
return d, alle, nil
|
||||
}
|
||||
|
||||
func findDomain(c *pb.Cluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
|
||||
func findDomain(c *pb.NewCluster, domcfg *libvirtxml.Domain) (*pb.Droplet, error) {
|
||||
var found *pb.Droplet
|
||||
if domcfg == nil {
|
||||
return nil, errors.New("domcfg == nil")
|
||||
}
|
||||
|
||||
for _, d := range c.Droplets {
|
||||
loop := c.DropletsAll() // get the list of droplets
|
||||
for loop.Scan() {
|
||||
d := loop.Droplet()
|
||||
if d.Hostname == domcfg.Name {
|
||||
if d.Uuid != domcfg.UUID {
|
||||
if domcfg.UUID == "" {
|
||||
|
|
Loading…
Reference in New Issue