summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--http.go4
-rw-r--r--validate.go19
2 files changed, 19 insertions, 4 deletions
diff --git a/http.go b/http.go
index 629b973..937f9a7 100644
--- a/http.go
+++ b/http.go
@@ -102,7 +102,9 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
result, err := Start(hostname)
if err == nil {
fmt.Fprintln(w, result)
- fmt.Fprintln(w, hostname, "started ok")
+ fmt.Fprintln(w, hostname, "started output ok")
+ fmt.Fprintln(w, hostname, "need to parse the output here")
+ fmt.Fprintln(w, hostname, "todo: switch to protobuf here")
} else {
fmt.Fprintln(w, result)
fmt.Fprintln(w, err)
diff --git a/validate.go b/validate.go
index 5270484..a95ce29 100644
--- a/validate.go
+++ b/validate.go
@@ -230,8 +230,21 @@ func setUniqueSpicePort(check *pb.Droplet) error {
if d.SpicePort == 0 {
continue
}
- if _, ok := ports[d.SpicePort]; ok {
- log.Info("duplicate ports", d.SpicePort)
+ if dup, ok := ports[d.SpicePort]; ok {
+ // dup := ports[d.SpicePort]
+ log.Warn("duplicate ports", d.SpicePort, d.Hostname, d.CurrentState)
+ if d.CurrentState != pb.DropletState_ON {
+ // hack for now. should be safe to erase this
+ d.SpicePort = 0
+ log.Warn("erasing port for non-ON droplet", d.SpicePort, d.Hostname, d.CurrentState)
+ }
+ log.Warn("duplicate ports", dup.SpicePort, dup.Hostname, dup.CurrentState)
+ if dup.CurrentState != pb.DropletState_ON {
+ // hack for now. should be safe to erase this
+ dup.SpicePort = 0
+ log.Warn("erasing port for non-ON droplet", dup.SpicePort, dup.Hostname, dup.CurrentState)
+ }
+ // todo: fix this somewhow
return errors.New("duplicate ports")
}
ports[d.SpicePort] = d
@@ -242,7 +255,7 @@ func setUniqueSpicePort(check *pb.Droplet) error {
}
var start int64
- start = 5900
+ start = 5910
for {
if start == 6000 {
// x11 might use this on dom0's running a desktop