update AddDroplet()
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
7cff6fef31
commit
5868daa09e
|
@ -89,16 +89,14 @@ func (c *Cluster) AddHypervisor(hostname string, cpus int, mem int) *Hypervisor
|
||||||
return h
|
return h
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Cluster) AddDroplet(hostname string, cpus int, mem int) *Droplet {
|
func (c *Cluster) AddDroplet(uuid string, hostname string, cpus int, mem int) *Droplet {
|
||||||
d := c.FindDroplet(hostname)
|
d := c.FindDroplet(hostname)
|
||||||
if d != nil {
|
if d != nil {
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate a new UUID
|
|
||||||
id := uuid.New()
|
|
||||||
d = &Droplet{
|
d = &Droplet{
|
||||||
Uuid: id.String(),
|
Uuid: uuid,
|
||||||
Hostname: hostname,
|
Hostname: hostname,
|
||||||
Cpus: int64(cpus),
|
Cpus: int64(cpus),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue