Third time is a charm.

This commit is contained in:
Brad Sickles 2017-02-01 16:18:12 -05:00
parent 5a8f2d3f60
commit da12d8811a
1 changed files with 4 additions and 5 deletions

View File

@ -944,9 +944,8 @@ func (n *Node) DeriveVaultToken(args *structs.DeriveVaultTokenRequest,
// setErr is a helper for setting the recoverable error on the reply and
// logging it
setErr := func(e error, recoverable bool) {
if rerr, ok := structs.NewRecoverableError(e, recoverable).(*structs.RecoverableError); ok {
reply.Error = rerr
}
if e == nil { return }
reply.Error = structs.NewRecoverableError(e, recoverable).(*structs.RecoverableError)
n.srv.logger.Printf("[ERR] nomad.client: DeriveVaultToken failed (recoverable %v): %v", recoverable, e)
}
@ -1135,8 +1134,8 @@ func (n *Node) DeriveVaultToken(args *structs.DeriveVaultTokenRequest,
if rerr, ok := createErr.(*structs.RecoverableError); ok {
reply.Error = rerr
} else if rerr, ok = structs.NewRecoverableError(createErr, false).(*structs.RecoverableError); ok {
reply.Error = rerr
} else if err != nil {
reply.Error = structs.NewRecoverableError(createErr, false).(*structs.RecoverableError)
}
return nil