2769: code review comments
authorTim Pierce <twp@curoverse.com>
Thu, 31 Jul 2014 15:45:12 +0000 (11:45 -0400)
committerTim Pierce <twp@curoverse.com>
Thu, 31 Jul 2014 15:45:12 +0000 (11:45 -0400)
* Updated TODO in handler_test.go.
* Log DELETE requests in DeleteHandler.

Refs #2769

services/keep/src/keep/handler_test.go
services/keep/src/keep/handlers.go

index cab203d5a5904c5d40cb32486227061c24d31e82..2998f60427298f019f21871352f7db26a380fedf 100644 (file)
@@ -431,8 +431,13 @@ func TestIndexHandler(t *testing.T) {
 //
 //   TODO(twp):
 //
-//   * Delete block on read-only volume
-//     (test for 200 OK, response counts, confirm block not deleted)
+//   * Delete block on read-only and read-write volume
+//     (test for 200 OK, response with copies_deleted=1,
+//     copies_failed=1, confirm block deleted only on r/w volume)
+//
+//   * Delete block on read-only volume only
+//     (test for 200 OK, response with copies_deleted=0, copies_failed=1,
+//     confirm block not deleted)
 //
 func TestDeleteHandler(t *testing.T) {
        defer teardown()
index 234e21a8eadda17eae3c1e1bce4d1bfbaefe404e..b9b8caebfb81d3a7bd13b349f2883f065b52b9c8 100644 (file)
@@ -336,6 +336,7 @@ func GetVolumeStatus(volume string) *VolumeStatus {
 //
 func DeleteHandler(resp http.ResponseWriter, req *http.Request) {
        hash := mux.Vars(req)["hash"]
+       log.Printf("%s %s", req.Method, hash)
 
        // Confirm that this user is an admin and has a token with unlimited scope.
        var tok = GetApiToken(req)