diff --git a/internal/cmp/helper.go b/internal/cmp/helper.go index ad192da9..381f6185 100644 --- a/internal/cmp/helper.go +++ b/internal/cmp/helper.go @@ -4,19 +4,23 @@ package cmp import ( "context" + "log" "strconv" "strings" "github.com/HewlettPackard/hpegl-vmaas-cmp-go-sdk/pkg/client" + "github.com/HewlettPackard/hpegl-vmaas-terraform-resources/pkg/auth" ) func setMeta(meta interface{}, apiClient client.APIClientHandler) { - // Not needed when not using wrapper + // Not needed while using cmp directly - // err := apiClient.SetMeta(meta, auth.SetScmClientToken) - // if err != nil { - // log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err) - // } +} +func setMetaHpegl(meta interface{}, apiClient client.APIClientHandler) { + err := apiClient.SetMeta(meta, auth.SetScmClientToken) + if err != nil { + log.Printf("[ERROR] error while setting meta information for cmp-sdk, error: %v", err) + } } func ParseVersion(version string) (int, error) { diff --git a/internal/cmp/morpheus_datasource_broker.go b/internal/cmp/morpheus_datasource_broker.go index f7319d56..bef005bc 100644 --- a/internal/cmp/morpheus_datasource_broker.go +++ b/internal/cmp/morpheus_datasource_broker.go @@ -23,7 +23,7 @@ func newMorpheusBroker(bClient *client.BrokerAPIService) *morpheusBroker { // Read reads the morpheus details using the Broker API func (m *morpheusBroker) Read(ctx context.Context, d *utils.Data, meta interface{}) error { - setMeta(meta, m.bClient.Client) + setMetaHpegl(meta, m.bClient.Client) // Get Morpheus Tokens and URL morpheusDetails, err := m.bClient.GetMorpheusDetails(ctx)