Skip to content

Commit

Permalink
refactor: simplify negotiateONTAPAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds committed Nov 13, 2024
1 parent 2c3c057 commit 7e2926b
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions cmd/collectors/ontap.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,12 @@ import (

func GatherClusterInfo(pollerName string, cred *auth.Credentials) (conf.Remote, error) {

var (
err error
)

remoteZapi, err := checkZapi(pollerName, cred)
if err != nil {
return conf.Remote{}, err
}

remoteRest, err := checkRest(pollerName, cred)
if err != nil {
return remoteZapi, err
}
remoteZapi, errZapi := checkZapi(pollerName, cred)
remoteRest, errRest := checkRest(pollerName, cred)

remoteRest.ZAPIsExist = remoteZapi.ZAPIsExist

return remoteRest, nil
return remoteRest, errors.Join(errZapi, errRest)
}

func checkRest(pollerName string, cred *auth.Credentials) (conf.Remote, error) {
Expand Down

0 comments on commit 7e2926b

Please sign in to comment.