Skip to content

Commit

Permalink
fixing the linting problems
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlapao committed Nov 22, 2023
1 parent 40a63bb commit 8364dcf
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 118 deletions.
20 changes: 16 additions & 4 deletions internal/authorization/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,14 @@ func updateUsers(ctx context.Context, hostConfig apiclient.HostConfig, data, cur
continue
} else {
tflog.Info(ctx, fmt.Sprintf("User %s created", user.Username.ValueString()))
updateUserClaims(ctx, hostConfig, data, currentData, i)
updateUserRoles(ctx, hostConfig, data, currentData, i)
if diag := updateUserClaims(ctx, hostConfig, data, currentData, i); diag.HasError() {
diagnostics.Append(diag...)
continue
}
if diag := updateUserRoles(ctx, hostConfig, data, currentData, i); diag.HasError() {
diagnostics.Append(diag...)
continue
}
data.Users[i].Id = types.StringValue(response.ID)
}
} else {
Expand All @@ -779,8 +785,14 @@ func updateUsers(ctx context.Context, hostConfig apiclient.HostConfig, data, cur
continue
}
tflog.Info(ctx, fmt.Sprintf("User %s found, updating id %v", userExists.Name, userExists.ID))
updateUserClaims(ctx, hostConfig, data, currentData, i)
updateUserRoles(ctx, hostConfig, data, currentData, i)
if diag := updateUserClaims(ctx, hostConfig, data, currentData, i); diag.HasError() {
diagnostics.Append(diag...)
continue
}
if diag := updateUserRoles(ctx, hostConfig, data, currentData, i); diag.HasError() {
diagnostics.Append(diag...)
continue
}
data.Users[i].Id = types.StringValue(userExists.ID)
}
}
Expand Down
94 changes: 0 additions & 94 deletions internal/deploy/api_service_template.go

This file was deleted.

4 changes: 2 additions & 2 deletions internal/helpers/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ func GetHostApiBaseUrl(host string) string {
}

func ConvertByteToGigabyte(bytes float64) float64 {
gb := float64(bytes) / 1024 / 1024 / 1024
gb := bytes / 1024 / 1024 / 1024
return math.Round(gb*100) / 100
}

func ConvertByteToMegabyte(bytes float64) float64 {
mb := float64(bytes) / 1024 / 1024
mb := bytes / 1024 / 1024
return math.Round(mb*100) / 100
}

Expand Down
34 changes: 17 additions & 17 deletions internal/provider/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@

package provider

import (
"testing"
// import (
// "testing"

"github.com/hashicorp/terraform-plugin-framework/providerserver"
"github.com/hashicorp/terraform-plugin-go/tfprotov6"
)
// "github.com/hashicorp/terraform-plugin-framework/providerserver"
// "github.com/hashicorp/terraform-plugin-go/tfprotov6"
// )

// testAccProtoV6ProviderFactories are used to instantiate a provider during
// acceptance testing. The factory function will be invoked for every Terraform
// CLI command executed to create a provider server to which the CLI can
// reattach.
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"scaffolding": providerserver.NewProtocol6WithError(New("test")()),
}
// // testAccProtoV6ProviderFactories are used to instantiate a provider during
// // acceptance testing. The factory function will be invoked for every Terraform
// // CLI command executed to create a provider server to which the CLI can
// // reattach.
// var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
// "scaffolding": providerserver.NewProtocol6WithError(New("test")()),
// }

func testAccPreCheck(t *testing.T) {
// You can add code here to run prior to any test case execution, for example assertions
// about the appropriate environment variables being set are common to see in a pre-check
// function.
}
// func testAccPreCheck(t *testing.T) {
// // You can add code here to run prior to any test case execution, for example assertions
// // about the appropriate environment variables being set are common to see in a pre-check
// // function.
// }
4 changes: 3 additions & 1 deletion internal/ssh/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type SshAuthorization struct {
}

type SshClient struct {
client *ssh.Client
config *ssh.ClientConfig
Host string
Port string
Expand Down Expand Up @@ -47,6 +46,9 @@ func NewSshClient(host, port string, auth SshAuthorization) (*SshClient, error)
}

signer, err := ssh.ParsePrivateKey(key)
if err != nil {
return nil, err
}
config = &ssh.ClientConfig{
User: globalSshClient.Auth.User,
Auth: []ssh.AuthMethod{
Expand Down

0 comments on commit 8364dcf

Please sign in to comment.