Skip to content

Commit

Permalink
remove unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnayak committed Apr 24, 2018
1 parent 4222df3 commit 3c49d7b
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions builtin/credential/approle/path_tidy_user_id.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,10 @@ func (b *backend) tidySecretID(ctx context.Context, s logical.Storage) error {
}

secretIDCleanupFunc := func(secretIDHMAC, roleNameHMAC, secretIDPrefixToUse string) error {
// In order to avoid lock swapping in case there is need to delete,
// grab the write lock.
lock := b.secretIDLock(secretIDHMAC)
lock.Lock()
defer lock.Unlock()

// roleNameHMAC will already have a '/' suffix. Don't append another one.
entryIndex := fmt.Sprintf("%s%s%s", secretIDPrefixToUse, roleNameHMAC, secretIDHMAC)
secretIDEntry, err := s.Get(ctx, entryIndex)
if err != nil {
Expand Down Expand Up @@ -107,7 +104,6 @@ func (b *backend) tidySecretID(ctx context.Context, s logical.Storage) error {
}

for _, roleNameHMAC := range roleNameHMACs {
// roleNameHMAC will already have a '/' suffix. Don't append another one.
secretIDHMACs, err := s.List(ctx, fmt.Sprintf("%s%s", secretIDPrefixToUse, roleNameHMAC))
if err != nil {
return err
Expand Down

0 comments on commit 3c49d7b

Please sign in to comment.