provider/openstack: Revert Security Group Rule Fix
This commit reverts the patch from #3796. It has been discovered that multiple rules are being reported out of order when the configuration is applied multiple times. I feel this is a larger issue than the bug this patch originally fixed, so until I can resolve it, I am reverting the patch.
This commit is contained in:
parent
3c02c5ee27
commit
29636dc51d
|
@ -131,10 +131,10 @@ func resourceComputeSecGroupV2Read(d *schema.ResourceData, meta interface{}) err
|
||||||
d.Set("description", sg.Description)
|
d.Set("description", sg.Description)
|
||||||
rtm := rulesToMap(sg.Rules)
|
rtm := rulesToMap(sg.Rules)
|
||||||
for _, v := range rtm {
|
for _, v := range rtm {
|
||||||
if v["from_group_id"] == d.Get("name") {
|
if v["group"] == d.Get("name") {
|
||||||
v["self"] = true
|
v["self"] = "1"
|
||||||
} else {
|
} else {
|
||||||
v["self"] = false
|
v["self"] = "0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("[DEBUG] rulesToMap(sg.Rules): %+v", rtm)
|
log.Printf("[DEBUG] rulesToMap(sg.Rules): %+v", rtm)
|
||||||
|
@ -288,7 +288,7 @@ func rulesToMap(sgrs []secgroups.Rule) []map[string]interface{} {
|
||||||
"to_port": sgr.ToPort,
|
"to_port": sgr.ToPort,
|
||||||
"ip_protocol": sgr.IPProtocol,
|
"ip_protocol": sgr.IPProtocol,
|
||||||
"cidr": sgr.IPRange.CIDR,
|
"cidr": sgr.IPRange.CIDR,
|
||||||
"from_group_id": sgr.Group.Name,
|
"group": sgr.Group.Name,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sgrMap
|
return sgrMap
|
||||||
|
|
Loading…
Reference in New Issue