provider/openstack: Use security_groups as native set when update
This commit is contained in:
parent
d2cf45a057
commit
59828deb0f
|
@ -601,9 +601,8 @@ func resourceComputeInstanceV2Update(d *schema.ResourceData, meta interface{}) e
|
|||
|
||||
if d.HasChange("security_groups") {
|
||||
oldSGRaw, newSGRaw := d.GetChange("security_groups")
|
||||
oldSGSlice, newSGSlice := oldSGRaw.([]interface{}), newSGRaw.([]interface{})
|
||||
oldSGSet := schema.NewSet(func(v interface{}) int { return hashcode.String(v.(string)) }, oldSGSlice)
|
||||
newSGSet := schema.NewSet(func(v interface{}) int { return hashcode.String(v.(string)) }, newSGSlice)
|
||||
oldSGSet := oldSGRaw.(*schema.Set)
|
||||
newSGSet := newSGRaw.(*schema.Set)
|
||||
secgroupsToAdd := newSGSet.Difference(oldSGSet)
|
||||
secgroupsToRemove := oldSGSet.Difference(newSGSet)
|
||||
|
||||
|
|
Loading…
Reference in New Issue