Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename some function #241

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FredericBerot-Armand
Copy link
Contributor

No description provided.

Copy link
Contributor

@outscale-mgo outscale-mgo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stope midway, but could you keep only the renaming in this PR, and move the change using utils.XXX in another PR, as this could introduce a breakage.

@@ -344,19 +344,3 @@ func buildOutscaleOAPIDataSourceImagesFilters(set *schema.Set) *oscgo.FiltersIma
}
return filters
}

func expandStringValueList(configured []interface{}) []string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move that to another PR please

}
if ownersOk {
filtersReq.SetAccountIds([]string{aids.(string)})
}
if executableUsersOk {
filtersReq.SetPermissionsToLaunchAccountIds(expandStringValueList(executableUsers.([]interface{})))
filtersReq.SetPermissionsToLaunchAccountIds(utils.InterfaceSliceToStringSlice(executableUsers.([]interface{})))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you move that to another PR please

@@ -337,7 +337,7 @@ func dataSourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interfa
}
d.Set("load_balancer_type", lb.LoadBalancerType)
if lb.SecurityGroups != nil {
d.Set("security_groups", flattenStringList(lb.SecurityGroups))
d.Set("security_groups", utils.StringSlicePtrToInterfaceSlice(lb.SecurityGroups))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


lb, _, err := readLbs0(conn, d)

if err != nil {
return err
}

d.Set("subregion_names", flattenStringList(lb.SubregionNames))
d.Set("subregion_names", utils.StringSlicePtrToInterfaceSlice(lb.SubregionNames))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here


d.Set("backend_vm_ids", flattenStringList(lb.BackendVmIds))
if err := d.Set("listeners", flattenOAPIListeners(lb.Listeners)); err != nil {
d.Set("backend_vm_ids", utils.StringSlicePtrToInterfaceSlice(lb.BackendVmIds))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -351,7 +351,7 @@ func dataSourceOutscaleOAPILoadBalancerRead(d *schema.ResourceData, meta interfa
d.Set("secured_cookies", lb.SecuredCookies)
d.Set("net_id", lb.NetId)
d.Set("source_security_group", ssg)
d.Set("subnets", flattenStringList(lb.Subnets))
d.Set("subnets", utils.StringSlicePtrToInterfaceSlice(lb.Subnets))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -153,7 +153,7 @@ func dataSourceOutscaleOAPILoadBalancerLDRuleRead(d *schema.ResourceData, meta i
}

if lr.VmIds != nil {
d.Set("vm_ids", flattenStringList(lr.VmIds))
d.Set("vm_ids", utils.StringSlicePtrToInterfaceSlice(lr.VmIds))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -166,7 +166,7 @@ func dataSourceOutscaleOAPILoadBalancerLDRulesRead(d *schema.ResourceData, meta
}

if lr.VmIds != nil {
l["vm_ids"] = flattenStringList(lr.VmIds)
l["vm_ids"] = utils.StringSlicePtrToInterfaceSlice(lr.VmIds)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@@ -31,7 +31,7 @@ func dataSourceOutscaleOAPILBUTagsRead(d *schema.ResourceData, meta interface{})
names := ename.([]interface{})

req := oscgo.ReadLoadBalancerTagsRequest{
LoadBalancerNames: *expandStringList(names),
LoadBalancerNames: utils.InterfaceSliceToStringSlice(names),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants