diff options
| author | Jeff Carr <[email protected]> | 2024-10-23 19:15:51 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-10-23 19:15:51 -0500 |
| commit | d09f4e25c25dced54d688597b5e9a903c456573d (patch) | |
| tree | 92fe88c807cbb41ef3f60047cd57a493d072db88 /http.go | |
| parent | 3ce3a0d7f640a71873eea29c70234ec9f4257b03 (diff) | |
switched to pb.DropletState enum
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'http.go')
| -rw-r--r-- | http.go | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -7,6 +7,7 @@ import ( "time" "go.wit.com/lib/gui/shell" + pb "go.wit.com/lib/protobuf/virtbuf" "go.wit.com/log" ) @@ -23,7 +24,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { // is the cluster running what it should? if tmp == "/droplets" { for _, d := range me.droplets { - if d.pb.StartState != "ON" { + if d.pb.StartState != pb.DropletState_ON { continue } dur := time.Since(d.lastpoll) // Calculate the elapsed time @@ -33,7 +34,7 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } else { hname = d.h.pb.Hostname } - if d.CurrentState != "ON" { + if d.CurrentState != pb.DropletState_ON { fmt.Fprintln(w, "BAD STATE ", d.pb.Hostname, hname, "(", d.pb.StartState, "vs", d.CurrentState, ")", shell.FormatDuration(dur)) } else { dur := time.Since(d.lastpoll) // Calculate the elapsed time |
