Skip to content

Commit

Permalink
Fix other usages of initKeyring func to use logger as third argument
Browse files Browse the repository at this point in the history
  • Loading branch information
picatz authored and fredrikhgrelland committed Oct 22, 2020
1 parent 817efe2 commit def7951
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions command/agent/keyring_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"os"
"path/filepath"
"testing"

"github.com/hashicorp/go-hclog"
)

func TestAgent_LoadKeyrings(t *testing.T) {
Expand Down Expand Up @@ -56,8 +58,10 @@ func TestAgent_InitKeyring(t *testing.T) {

file := filepath.Join(dir, "keyring")

logger := hclog.NewNullLogger()

// First initialize the keyring
if err := initKeyring(file, key1); err != nil {
if err := initKeyring(file, key1, logger); err != nil {
t.Fatalf("err: %s", err)
}

Expand All @@ -70,7 +74,7 @@ func TestAgent_InitKeyring(t *testing.T) {
}

// Try initializing again with a different key
if err := initKeyring(file, key2); err != nil {
if err := initKeyring(file, key2, logger); err != nil {
t.Fatalf("err: %s", err)
}

Expand Down
2 changes: 1 addition & 1 deletion command/agent/testagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ RETRY:
if a.Key != "" {
writeKey := func(key, filename string) {
path := filepath.Join(a.Config.DataDir, filename)
if err := initKeyring(path, key); err != nil {
if err := initKeyring(path, key, a.logger); err != nil {
a.T.Fatalf("Error creating keyring %s: %s", path, err)
}
}
Expand Down

0 comments on commit def7951

Please sign in to comment.