bhouse-nexthop commented on code in PR #281:
URL:
https://github.com/apache/cloudstack-terraform-provider/pull/281#discussion_r2912366996
##########
cloudstack/resource_cloudstack_network_acl_rule.go:
##########
@@ -596,87 +843,108 @@ func resourceCloudStackNetworkACLRuleRead(d
*schema.ResourceData, meta interface
// Create an empty rule list to hold all rules
var rules []interface{}
- // Read all rules that are configured
- if rs := d.Get("rule").([]interface{}); len(rs) > 0 {
- for _, rule := range rs {
- rule := rule.(map[string]interface{})
- uuids := rule["uuids"].(map[string]interface{})
- log.Printf("[DEBUG] Processing rule with protocol=%s,
uuids=%+v", rule["protocol"].(string), uuids)
-
- if rule["protocol"].(string) == "icmp" {
- id, ok := uuids["icmp"]
- if !ok {
- log.Printf("[DEBUG] No ICMP UUID found,
skipping rule")
- continue
- }
+ // Determine which field is being used and get the rules list
+ var configuredRules []interface{}
+ usingRuleset := false
+ if rs := d.Get("ruleset").(*schema.Set); rs != nil && rs.Len() > 0 {
+ usingRuleset = true
+ configuredRules = rs.List()
+ } else if rs := d.Get("rule").([]interface{}); len(rs) > 0 {
+ configuredRules = rs
+ }
Review Comment:
fixed in bdfa430
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]