add droplet() defaults to start state=off
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
efc3032d83
commit
d51c4627f7
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
|
||||
pb "go.wit.com/lib/protobuf/virtbuf"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
|
@ -28,8 +29,20 @@ func importDomain(w http.ResponseWriter, r *http.Request) (string, error) {
|
|||
fmt.Fprintln(w, result)
|
||||
return result, errors.New(result)
|
||||
}
|
||||
start := fmt.Sprintf("%-9s %-20s", d.Current.Hypervisor, name)
|
||||
if d.Current.State != pb.DropletState_OFF {
|
||||
result := "libvirt domain " + name + " found on " + d.Current.Hypervisor
|
||||
log.Info(result)
|
||||
fmt.Fprintln(w, result)
|
||||
}
|
||||
if d.LocalOnly == "" {
|
||||
result := start + " local duplicate defined (need to resolve this)"
|
||||
log.Log(WARN, result)
|
||||
fmt.Fprintln(w, result)
|
||||
return result, nil
|
||||
}
|
||||
result := start + " local ready to import from hypervisor"
|
||||
log.Log(WARN, result)
|
||||
fmt.Fprintln(w, result)
|
||||
return result, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue