Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
manjunath-batakurki committed Feb 3, 2022
1 parent c454a59 commit 72dfe32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions internal/acceptance_test/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func getAPIClient() (*api_client.APIClient, api_client.Configuration) {
}

apiClient := api_client.NewAPIClient(&cfg)
meta_err := apiClient.SetMeta(nil, func(ctx *context.Context, meta interface{}) {
err := apiClient.SetMeta(nil, func(ctx *context.Context, meta interface{}) {
d := &utils.ResourceData{
Data: map[string]interface{}{
"iam_service_url": os.Getenv("HPEGL_IAM_SERVICE_URL"),
Expand Down Expand Up @@ -64,8 +64,8 @@ func getAPIClient() (*api_client.APIClient, api_client.Configuration) {
}
})

if meta_err != nil {
log.Printf("[WARN] Error: %s", meta_err)
if err != nil {
log.Printf("[WARN] Error: %s", err)
}

return apiClient, cfg
Expand Down
3 changes: 2 additions & 1 deletion pkg/atf/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/md5"
"encoding/json"
"fmt"
"log"
"math/rand"
"runtime"
"strconv"
Expand Down Expand Up @@ -89,7 +90,7 @@ func newRand() *rand.Rand {
m := md5.New()
_, err := m.Write([]byte(s))
if err != nil {
panic(err)
log.Printf("[WARN]: Error while writing to Hash object %s", err)
}
sourceStr := m.Sum(nil)
var sourceInt int64
Expand Down
6 changes: 3 additions & 3 deletions pkg/utils/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func SetMeta(apiClient *client.APIClient, r *schema.ResourceData) {
meta_err := apiClient.SetMeta(nil, func(ctx *context.Context, meta interface{}) {
err := apiClient.SetMeta(nil, func(ctx *context.Context, meta interface{}) {
// Initialise token handler
h, err := serviceclient.NewHandler(r)
if err != nil {
Expand All @@ -28,7 +28,7 @@ func SetMeta(apiClient *client.APIClient, r *schema.ResourceData) {
}
})

if meta_err != nil {
log.Printf("[WARN] Error: %s", meta_err)
if err != nil {
log.Printf("[WARN] Error: %s", err)
}
}

0 comments on commit 72dfe32

Please sign in to comment.