Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseakomlo committed Oct 16, 2017
1 parent d186840 commit 27cef91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions nomad/acl_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G
if err != nil {
return fmt.Errorf("token lookup failed: %v", err)
}
if token == nil { // why continue if the token is nil???
if token == nil {
nonexistentTokens = append(nonexistentTokens, accessor)
continue
}
Expand All @@ -597,7 +597,7 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G
}

if len(nonexistentTokens) != 0 {
return fmt.Errorf("Cannot delete nonexistant tokens: %v", strings.Join(nonexistentTokens, ", "))
return fmt.Errorf("Cannot delete nonexistent tokens: %v", strings.Join(nonexistentTokens, ", "))
}

// Disallow mixed requests with global and non-global tokens since we forward
Expand Down
2 changes: 1 addition & 1 deletion nomad/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ func TestACLEndpoint_DeleteTokens_WithNonexistantToken(t *testing.T) {
err := msgpackrpc.CallWithCodec(codec, "ACL.DeleteTokens", req, &resp)

assert.NotNil(err)
expectedError := fmt.Sprintf("Cannot delete nonexistant tokens: %s", nonExistentToken.AccessorID)
expectedError := fmt.Sprintf("Cannot delete nonexistent tokens: %s", nonExistentToken.AccessorID)
assert.Contains(expectedError, err.Error())
}

Expand Down

0 comments on commit 27cef91

Please sign in to comment.