Skip to content

Commit

Permalink
Renamed error message in alloc endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
diptanu committed May 29, 2016
1 parent 951b553 commit c760d59
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions client/driver/docker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,11 +837,8 @@ func TestDockerDriver_Stats(t *testing.T) {
defer cleanup()

go func() {
fmt.Println("GOING TO SLEEP")
time.Sleep(3 * time.Second)
fmt.Println("COMING OUT OF SLEEP")
ru, err := handle.Stats()
fmt.Printf("STATS CALL OVER ru: %#v, err: %v", ru, err)
if err != nil {
t.Fatalf("err: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion client/task_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ func (r *TaskRunner) ResourceUsageTS(since int64) []*cstructs.TaskResourceUsage
var idx int

for {
mid := (low + high) >> 1
mid := (low + high) / 2
midVal, _ := values[mid].(*cstructs.TaskResourceUsage)
if midVal.Timestamp < since {
low = mid + 1
Expand Down
4 changes: 2 additions & 2 deletions command/agent/alloc_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

const (
urlNotFoundErr = "url not found"
allocNotFoundErr = "allocation not found"
)

func (s *HTTPServer) AllocsRequest(resp http.ResponseWriter, req *http.Request) (interface{}, error) {
Expand Down Expand Up @@ -71,7 +71,7 @@ func (s *HTTPServer) ClientAllocRequest(resp http.ResponseWriter, req *http.Requ
// invoked on the alloc id
tokens := strings.Split(reqSuffix, "/")
if len(tokens) == 1 || tokens[1] != "stats" {
return nil, CodedError(404, urlNotFoundErr)
return nil, CodedError(404, allocNotFoundErr)
}
allocID := tokens[0]

Expand Down

0 comments on commit c760d59

Please sign in to comment.