Skip to content

Commit

Permalink
fixing lint issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sapana05 committed Sep 27, 2024
1 parent 57853be commit a0e98bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ func (g *DirectoryServiceAuthProviderDatasource) Read(ctx context.Context, req d
resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
}

func (g *DirectoryServiceAuthProviderDatasource) readDatasourceRedfishDSAuthProvider(d models.DirectoryServiceAuthProviderDatasource) (models.DirectoryServiceAuthProviderDatasource, diag.Diagnostics) {
func (g *DirectoryServiceAuthProviderDatasource) readDatasourceRedfishDSAuthProvider(d models.DirectoryServiceAuthProviderDatasource) (
models.DirectoryServiceAuthProviderDatasource, diag.Diagnostics) {
var diags diag.Diagnostics

accountService, err := g.service.AccountService()
Expand Down Expand Up @@ -232,33 +233,33 @@ func newAccountsState(input *redfish.AccountService) types.String {
}

func newAdditionalExternalAccountProvidersState(input *redfish.AccountService) types.String {
dellAccount, error := dell.DirectoryServiceAuthProvider(input)
dellAdditional, error := dell.DirectoryServiceAuthProvider(input)

Check warning on line 236 in redfish/provider/data_source_redfish_directory_service_auth_provider.go

View workflow job for this annotation

GitHub Actions / Check Go formatting, linting, vetting using golangci-lint

redefines-builtin-id: redefinition of the built-in type error (revive)

if error != nil {
return types.StringValue(BLANK)
}

return types.StringValue(dellAccount.AdditionalExternalAccountProviders.ODataID)
return types.StringValue(dellAdditional.AdditionalExternalAccountProviders.ODataID)
}

func newPrivilegeMapState(input *redfish.AccountService) types.String {
dellAccount, error := dell.DirectoryServiceAuthProvider(input)
dellPrivilegeMap, error := dell.DirectoryServiceAuthProvider(input)

Check warning on line 246 in redfish/provider/data_source_redfish_directory_service_auth_provider.go

View workflow job for this annotation

GitHub Actions / Check Go formatting, linting, vetting using golangci-lint

redefines-builtin-id: redefinition of the built-in type error (revive)

if error != nil {
return types.StringValue(BLANK)
}

return types.StringValue(dellAccount.PrivilegeMap.ODataID)
return types.StringValue(dellPrivilegeMap.PrivilegeMap.ODataID)
}

func newRolesState(input *redfish.AccountService) types.String {
dellAccount, error := dell.DirectoryServiceAuthProvider(input)
dellRole, error := dell.DirectoryServiceAuthProvider(input)

if error != nil {
return types.StringValue(BLANK)
}

return types.StringValue(dellAccount.Roles.ODataID)
return types.StringValue(dellRole.Roles.ODataID)
}

func newLocalAccountAuthState(input redfish.LocalAccountAuth) types.String {
Expand All @@ -284,7 +285,6 @@ func newDirectoryState(input *redfish.AccountService, directoryType string) *mod
}
}
func newActiveDirectoryState(input *redfish.AccountService) *models.ActiveDirectory {

inData := input.ActiveDirectory
return &models.ActiveDirectory{
Directory: newDirectoryState(input, ActiveDirectory),
Expand All @@ -293,19 +293,18 @@ func newActiveDirectoryState(input *redfish.AccountService) *models.ActiveDirect
}

func newCertificatesState(input *redfish.AccountService, directoryType string) types.String {

dellAccount, error := dell.DirectoryServiceAuthProvider(input)
dellCertificate, error := dell.DirectoryServiceAuthProvider(input)

if error != nil {
return types.StringValue(BLANK)
}

if directoryType == ActiveDirectory {
return types.StringValue(dellAccount.ActiveDirectoryCertificate.ODataID)
return types.StringValue(dellCertificate.ActiveDirectoryCertificate.ODataID)
}

if directoryType == LDAP {
return types.StringValue(dellAccount.LDAPCertificate.ODataID)
return types.StringValue(dellCertificate.LDAPCertificate.ODataID)
}

return types.StringValue(BLANK)
Expand Down
1 change: 1 addition & 0 deletions redfish/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ func (*redfishProvider) DataSources(_ context.Context) []func() datasource.DataS
NewSystemBootDatasource,
NewFirmwareInventoryDatasource,
NewNICDatasource,
NewDirectoryServiceAuthProviderDatasource,
}
}

Expand Down

0 comments on commit a0e98bc

Please sign in to comment.