minor cleanup

This commit is contained in:
Chris Hoffman 2017-11-06 16:36:37 -05:00
parent de8c0dce99
commit 1b387f75e3
2 changed files with 7 additions and 7 deletions

View File

@ -56,9 +56,9 @@ func (b *backend) readConfigAccess(storage logical.Storage) (*accessConfig, erro
func (b *backend) pathConfigAccessRead(
req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
conf, intErr := b.readConfigAccess(req.Storage)
if intErr != nil {
return nil, intErr
conf, err := b.readConfigAccess(req.Storage)
if err != nil {
return nil, err
}
if conf == nil {
return nil, fmt.Errorf("no user or internal error reported but nomad access configuration not found")

View File

@ -39,13 +39,13 @@ func (b *backend) secretTokenRenew(
func (b *backend) secretTokenRevoke(
req *logical.Request, d *framework.FieldData) (*logical.Response, error) {
c, intErr := b.client(req.Storage)
if intErr != nil {
return nil, intErr
c, err := b.client(req.Storage)
if err != nil {
return nil, err
}
tokenRaw := req.Secret.InternalData["accessor_id"]
_, err := c.ACLTokens().Delete(tokenRaw.(string), nil)
_, err = c.ACLTokens().Delete(tokenRaw.(string), nil)
if err != nil {
return nil, err
}