[ARVADOS] updated: c4b51836d29d37cb75c6432ce056d844cf27c3ac

git at public.curoverse.com git at public.curoverse.com
Fri Apr 11 07:04:41 EDT 2014


Summary of changes:
 services/keep/keep.go |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

       via  c4b51836d29d37cb75c6432ce056d844cf27c3ac (commit)
      from  3c554a995e2b4f716106876ffbd311e87cce4091 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit c4b51836d29d37cb75c6432ce056d844cf27c3ac
Author: Tim Pierce <twp at curoverse.com>
Date:   Fri Apr 11 07:02:42 2014 -0400

    Write status output in JSON. (refs #2561)

diff --git a/services/keep/keep.go b/services/keep/keep.go
index 4ee9fb3..71c2a8b 100644
--- a/services/keep/keep.go
+++ b/services/keep/keep.go
@@ -4,6 +4,7 @@ import (
 	"bufio"
 	"bytes"
 	"crypto/md5"
+	"encoding/json"
 	"errors"
 	"fmt"
 	"github.com/gorilla/mux"
@@ -209,6 +210,14 @@ func StatusHandler(w http.ResponseWriter, req *http.Request) {
 	for _, vol := range KeepVolumes {
 		st.Volumes[vol] = GetVolumeStatus(vol)
 	}
+
+	if jstat, err := json.Marshal(st); err == nil {
+		w.Write(jstat)
+	} else {
+		log.Printf("json.Marshal: %s\n", err)
+		log.Printf("NodeStatus = %v\n", st)
+		http.Error(w, err.Error(), 500)
+	}
 }
 
 // GetVolumeStatus

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list