Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
outscale-toa committed Oct 6, 2023
1 parent 4b55210 commit e75e6bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion outscale/data_source_outscale_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,5 @@ func getIops(volumeType string, iops int32) int32 {
if volumeType != "standard" {
return iops
}
return defaultIops
return utils.DefaultIops
}
4 changes: 2 additions & 2 deletions outscale/resource_outscale_nic_link.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func resourceOutscaleOAPINetworkInterfaceAttachmentRead(d *schema.ResourceData,
resp, err := stateConf.WaitForState()
if err != nil {
return fmt.Errorf(
"Error waiting for Volume to attach to Instance: %s, error: %s", nicID, err)
"Error waiting for NIC to attach to Instance: %s, error: %s", nicID, err)
}

r := resp.(oscgo.ReadNicsResponse)
Expand Down Expand Up @@ -206,7 +206,7 @@ func resourceOutscaleNetworkInterfaceAttachmentImportState(d *schema.ResourceDat
resp, err := stateConf.WaitForState()
if err != nil {
return nil, fmt.Errorf(
"Error waiting for Volume to attach to Instance: %s, error: %s", d.Id(), err)
"Error waiting for NIC to attach to Instance: %s, error: %s", d.Id(), err)
}
r := resp.(oscgo.ReadNicsResponse)
linkNic := r.GetNics()[0].GetLinkNic()
Expand Down
2 changes: 0 additions & 2 deletions outscale/resource_outscale_volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)

const defaultIops = 150

func resourceOutscaleOAPIVolume() *schema.Resource {
return &schema.Resource{
Create: resourceOAPIVolumeCreate,
Expand Down
2 changes: 1 addition & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const (
MaxPort int = 65535
MinIops int = 100
MaxIops int = 13000
DefaultIops int = 150
DefaultIops int32 = 150
MaxSize int = 14901
InvalidState string = "InvalidState"
VolumeIOPSError string = `
Expand Down

0 comments on commit e75e6bc

Please sign in to comment.