Skip to content

Commit

Permalink
Merge pull request #3966 from hashicorp/b-existent
Browse files Browse the repository at this point in the history
non-Existent -> nonexistent
  • Loading branch information
schmichael committed Mar 12, 2018
2 parents 9f57f3b + 8da7335 commit bc014b9
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ BUG FIXES:
set [[GH-2544](https://github.com/hashicorp/nomad/issues/2544)]
* server/periodic: Restoring periodic jobs takes launch time zone into
consideration [[GH-2808](https://github.com/hashicorp/nomad/issues/2808)]
* server/vault: Fix Vault Client panic when given nonExistent role [[GH-2648](https://github.com/hashicorp/nomad/issues/2648)]
* server/vault: Fix Vault Client panic when given nonexistent role [[GH-2648](https://github.com/hashicorp/nomad/issues/2648)]
* telemetry: Fix merging of use node name [[GH-2762](https://github.com/hashicorp/nomad/issues/2762)]

## 0.5.6 (March 31, 2017)
Expand Down
4 changes: 2 additions & 2 deletions api/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func TestAgent_Join(t *testing.T) {
})
defer s2.Stop()

// Attempting to join a non-Existent host returns error
// Attempting to join a nonexistent host returns error
n, err := a1.Join("nope")
if err == nil {
t.Fatalf("expected error, got nothing")
Expand Down Expand Up @@ -123,7 +123,7 @@ func TestAgent_ForceLeave(t *testing.T) {
defer s.Stop()
a := c.Agent()

// Force-leave on a non-Existent node does not error
// Force-leave on a nonexistent node does not error
if err := a.ForceLeave("nope"); err != nil {
t.Fatalf("err: %s", err)
}
Expand Down
2 changes: 1 addition & 1 deletion api/evaluations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestEvaluations_Info(t *testing.T) {
defer s.Stop()
e := c.Evaluations()

// Querying a non-Existent evaluation returns error
// Querying a nonexistent evaluation returns error
_, _, err := e.Info("8E231CF4-CA48-43FF-B694-5801E69E22FA", nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %s", err)
Expand Down
8 changes: 4 additions & 4 deletions api/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ func TestJobs_Allocations(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

// Looking up by a non-Existent job returns nothing
// Looking up by a nonexistent job returns nothing
allocs, qm, err := jobs.Allocations("job1", true, nil)
if err != nil {
t.Fatalf("err: %s", err)
Expand All @@ -914,7 +914,7 @@ func TestJobs_Evaluations(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

// Looking up by a non-Existent job ID returns nothing
// Looking up by a nonexistent job ID returns nothing
evals, qm, err := jobs.Evaluations("job1", nil)
if err != nil {
t.Fatalf("err: %s", err)
Expand Down Expand Up @@ -1016,7 +1016,7 @@ func TestJobs_ForceEvaluate(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

// Force-eval on a non-Existent job fails
// Force-eval on a non-existent job fails
_, _, err := jobs.ForceEvaluate("job1", nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %#v", err)
Expand Down Expand Up @@ -1056,7 +1056,7 @@ func TestJobs_PeriodicForce(t *testing.T) {
defer s.Stop()
jobs := c.Jobs()

// Force-eval on a non-Existent job fails
// Force-eval on a nonexistent job fails
_, _, err := jobs.PeriodicForce("job1", nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %#v", err)
Expand Down
6 changes: 3 additions & 3 deletions api/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestNodes_Info(t *testing.T) {
defer s.Stop()
nodes := c.Nodes()

// Retrieving a non-Existent node returns error
// Retrieving a nonexistent node returns error
_, _, err := nodes.Info("12345678-abcd-efab-cdef-123456789abc", nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %#v", err)
Expand Down Expand Up @@ -208,7 +208,7 @@ func TestNodes_Allocations(t *testing.T) {
defer s.Stop()
nodes := c.Nodes()

// Looking up by a non-Existent node returns nothing. We
// Looking up by a nonexistent node returns nothing. We
// don't check the index here because it's possible the node
// has already registered, in which case we will get a non-
// zero result anyways.
Expand All @@ -229,7 +229,7 @@ func TestNodes_ForceEvaluate(t *testing.T) {
defer s.Stop()
nodes := c.Nodes()

// Force-eval on a non-Existent node fails
// Force-eval on a nonexistent node fails
_, _, err := nodes.ForceEvaluate("12345678-abcd-efab-cdef-123456789abc", nil)
if err == nil || !strings.Contains(err.Error(), "not found") {
t.Fatalf("expected not found error, got: %#v", err)
Expand Down
16 changes: 8 additions & 8 deletions client/allocdir/fs_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ func TestLinuxRootSecretDir(t *testing.T) {

secretsDir := filepath.Join(tmpdir, TaskSecrets)

// removing a nonExistent secrets dir should NOT error
// removing a nonexistent secrets dir should NOT error
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}
// run twice as it should be idempotent
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}

// creating a secrets dir should work
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestLinuxRootSecretDir(t *testing.T) {

// removing again should be a noop
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}
}

Expand All @@ -120,13 +120,13 @@ func TestLinuxUnprivilegedSecretDir(t *testing.T) {

secretsDir := filepath.Join(tmpdir, TaskSecrets)

// removing a nonExistent secrets dir should NOT error
// removing a nonexistent secrets dir should NOT error
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}
// run twice as it should be idempotent
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}

// creating a secrets dir should work
Expand Down Expand Up @@ -162,6 +162,6 @@ func TestLinuxUnprivilegedSecretDir(t *testing.T) {

// removing again should be a noop
if err := removeSecretDir(secretsDir); err != nil {
t.Fatalf("error removing nonExistent secrets dir %q: %v", secretsDir, err)
t.Fatalf("error removing nonexistent secrets dir %q: %v", secretsDir, err)
}
}
6 changes: 3 additions & 3 deletions client/allocdir/task_dir_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ func TestLinuxSpecialDirs(t *testing.T) {
// Despite the task dir not existing, unmountSpecialDirs should *not*
// return an error
if err := td.unmountSpecialDirs(); err != nil {
t.Fatalf("error removing nonExistent special dirs: %v", err)
t.Fatalf("error removing nonexistent special dirs: %v", err)
}

// Mounting special dirs in a nonExistent task dir *should* return an
// Mounting special dirs in a nonexistent task dir *should* return an
// error
if err := td.mountSpecialDirs(); err == nil {
t.Fatalf("expected mounting in a nonExistent task dir %q to fail", td.Dir)
t.Fatalf("expected mounting in a nonexistent task dir %q to fail", td.Dir)
}

// Create the task dir like TaskDir.Build would
Expand Down
4 changes: 2 additions & 2 deletions client/allocdir/task_dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
cstructs "github.com/hashicorp/nomad/client/structs"
)

// Test that building a chroot will skip nonExistent directories.
func TestTaskDir_EmbedNonExistent(t *testing.T) {
// Test that building a chroot will skip nonexistent directories.
func TestTaskDir_EmbedNonexistent(t *testing.T) {
tmp, err := ioutil.TempDir("", "AllocDir")
if err != nil {
t.Fatalf("Couldn't create temp dir: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion client/driver/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1797,7 +1797,7 @@ func (h *DockerHandle) Kill() error {

// Container has already been removed.
if strings.Contains(err.Error(), NoSuchContainerError) {
h.logger.Printf("[DEBUG] driver.docker: attempted to stop non-Existent container %s", h.containerID)
h.logger.Printf("[DEBUG] driver.docker: attempted to stop nonexistent container %s", h.containerID)
return nil
}
h.logger.Printf("[ERR] driver.docker: failed to stop container %s: %v", h.containerID, err)
Expand Down
2 changes: 1 addition & 1 deletion client/driver/rkt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ func TestRktDriver_Remove_Error(t *testing.T) {

ctestutils.RktCompatible(t)

// Removing a non-Existent pod should return an error
// Removing a nonexistent pod should return an error
if err := rktRemove("00000000-0000-0000-0000-000000000000"); err == nil {
t.Fatalf("expected an error")
}
Expand Down
2 changes: 1 addition & 1 deletion client/vaultclient/vaultclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ func TestVaultClient_RenewNonRenewableLease(t *testing.T) {
}
}

func TestVaultClient_RenewNonExistentLease(t *testing.T) {
func TestVaultClient_RenewNonexistentLease(t *testing.T) {
t.Parallel()
v := testutil.NewTestVault(t)
defer v.Stop()
Expand Down
2 changes: 1 addition & 1 deletion command/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestInspectCommand_Fails(t *testing.T) {
}
ui.ErrorWriter.Reset()

// Fails on non-Existent job ID
// Fails on nonexistent job ID
if code := cmd.Run([]string{"-address=" + url, "nope"}); code != 1 {
t.Fatalf("expect exit 1, got: %d", code)
}
Expand Down
2 changes: 1 addition & 1 deletion command/node_drain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestNodeDrainCommand_Fails(t *testing.T) {
}
ui.ErrorWriter.Reset()

// Fails on non-Existent node
// Fails on nonexistent node
if code := cmd.Run([]string{"-address=" + url, "-enable", "12345678-abcd-efab-cdef-123456789abc"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
Expand Down
2 changes: 1 addition & 1 deletion command/node_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func TestNodeStatusCommand_Fails(t *testing.T) {
}
ui.ErrorWriter.Reset()

// Fails on non-Existent node
// Fails on nonexistent node
if code := cmd.Run([]string{"-address=" + url, "12345678-abcd-efab-cdef-123456789abc"}); code != 1 {
t.Fatalf("expected exit 1, got: %d", code)
}
Expand Down
2 changes: 1 addition & 1 deletion command/stop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestStopCommand_Fails(t *testing.T) {
}
ui.ErrorWriter.Reset()

// Fails on non-Existent job ID
// Fails on nonexistent job ID
if code := cmd.Run([]string{"-address=" + url, "nope"}); code != 1 {
t.Fatalf("expect exit 1, got: %d", code)
}
Expand Down
8 changes: 4 additions & 4 deletions nomad/acl_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,14 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G
// Determine if we are deleting local or global tokens
hasGlobal := false
allGlobal := true
nonExistentTokens := make([]string, 0)
nonexistentTokens := make([]string, 0)
for _, accessor := range args.AccessorIDs {
token, err := state.ACLTokenByAccessorID(nil, accessor)
if err != nil {
return fmt.Errorf("token lookup failed: %v", err)
}
if token == nil {
nonExistentTokens = append(nonExistentTokens, accessor)
nonexistentTokens = append(nonexistentTokens, accessor)
continue
}
if token.Global {
Expand All @@ -596,8 +596,8 @@ func (a *ACL) DeleteTokens(args *structs.ACLTokenDeleteRequest, reply *structs.G
}
}

if len(nonExistentTokens) != 0 {
return fmt.Errorf("Cannot delete nonExistent tokens: %v", strings.Join(nonExistentTokens, ", "))
if len(nonexistentTokens) != 0 {
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
8 changes: 4 additions & 4 deletions nomad/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ func TestACLEndpoint_DeleteTokens(t *testing.T) {
assert.NotEqual(t, uint64(0), resp.Index)
}

func TestACLEndpoint_DeleteTokens_WithNonExistentToken(t *testing.T) {
func TestACLEndpoint_DeleteTokens_WithNonexistentToken(t *testing.T) {
t.Parallel()
assert := assert.New(t)

Expand All @@ -916,11 +916,11 @@ func TestACLEndpoint_DeleteTokens_WithNonExistentToken(t *testing.T) {
codec := rpcClient(t, s1)
testutil.WaitForLeader(t, s1.RPC)

nonExistentToken := mock.ACLToken()
nonexistentToken := mock.ACLToken()

// Lookup the policies
req := &structs.ACLTokenDeleteRequest{
AccessorIDs: []string{nonExistentToken.AccessorID},
AccessorIDs: []string{nonexistentToken.AccessorID},
WriteRequest: structs.WriteRequest{
Region: "global",
AuthToken: root.SecretID,
Expand All @@ -930,7 +930,7 @@ func TestACLEndpoint_DeleteTokens_WithNonExistentToken(t *testing.T) {
err := msgpackrpc.CallWithCodec(codec, "ACL.DeleteTokens", req, &resp)

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

Expand Down
2 changes: 1 addition & 1 deletion nomad/alloc_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ func TestAllocEndpoint_GetAllocs(t *testing.T) {
t.Fatalf("bad: %#v", resp.Allocs)
}

// Lookup non-Existent allocs.
// Lookup nonexistent allocs.
get = &structs.AllocsGetRequest{
AllocIDs: []string{"foo"},
QueryOptions: structs.QueryOptions{Region: "global"},
Expand Down
2 changes: 1 addition & 1 deletion nomad/eval_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ func TestEvalEndpoint_Allocations_Blocking(t *testing.T) {
}
}

func TestEvalEndpoint_Reblock_NonExistent(t *testing.T) {
func TestEvalEndpoint_Reblock_Nonexistent(t *testing.T) {
t.Parallel()
s1 := TestServer(t, func(c *Config) {
c.NumSchedulers = 0 // Prevent automatic dequeue
Expand Down
2 changes: 1 addition & 1 deletion nomad/fsm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func TestFSM_RegisterJob_BadNamespace(t *testing.T) {
if !ok {
t.Fatalf("resp not of error type: %T %v", resp, resp)
}
if !strings.Contains(err.Error(), "non-Existent namespace") {
if !strings.Contains(err.Error(), "nonexistent namespace") {
t.Fatalf("bad error: %v", err)
}

Expand Down
4 changes: 2 additions & 2 deletions nomad/job_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func TestJobEndpoint_Register_InvalidNamespace(t *testing.T) {
// Try without a token, expect failure
var resp structs.JobRegisterResponse
err := msgpackrpc.CallWithCodec(codec, "Job.Register", req, &resp)
if err == nil || !strings.Contains(err.Error(), "non-Existent namespace") {
if err == nil || !strings.Contains(err.Error(), "nonexistent namespace") {
t.Fatalf("expected namespace error: %v", err)
}

Expand Down Expand Up @@ -1684,7 +1684,7 @@ func TestJobEndpoint_Deregister_ACL(t *testing.T) {
assert.Equal(eval.Status, structs.EvalStatusPending)
}

func TestJobEndpoint_Deregister_NonExistent(t *testing.T) {
func TestJobEndpoint_Deregister_Nonexistent(t *testing.T) {
t.Parallel()
s1 := TestServer(t, func(c *Config) {
c.NumSchedulers = 0 // Prevent automatic dequeue
Expand Down
2 changes: 1 addition & 1 deletion nomad/state/state_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ func (s *StateStore) upsertJobImpl(index uint64, job *structs.Job, keepVersion b
if exists, err := s.namespaceExists(txn, job.Namespace); err != nil {
return err
} else if !exists {
return fmt.Errorf("job %q is in non-Existent namespace %q", job.ID, job.Namespace)
return fmt.Errorf("job %q is in nonexistent namespace %q", job.ID, job.Namespace)
}

// Check if the job already exists
Expand Down
Loading

0 comments on commit bc014b9

Please sign in to comment.