Skip to content

Commit da84245

Browse files
committed
handle review comments
1 parent 38b6ed7 commit da84245

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cloudstack/resource_cloudstack_network_acl_rule.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,8 @@ func createNetworkACLRule(d *schema.ResourceData, meta interface{}, rule map[str
210210
p := cs.NetworkACL.NewCreateNetworkACLParams(rule["protocol"].(string))
211211

212212
// If a rule ID is specified, set it
213-
if ruleId, ok := rule["rule_number"].(int); ok && ruleId > 0 {
214-
p.SetNumber(ruleId)
213+
if ruleNum, ok := rule["rule_number"].(int); ok && ruleNum > 0 {
214+
p.SetNumber(ruleNum)
215215
}
216216

217217
// Set the acl ID
@@ -645,11 +645,11 @@ func verifyNetworkACLParams(d *schema.ResourceData) error {
645645

646646
func verifyNetworkACLRuleParams(d *schema.ResourceData, rule map[string]interface{}) error {
647647
if ruleNum, ok := rule["rule_number"]; ok && ruleNum != nil {
648-
if rId, ok := ruleNum.(int); ok && rId != 0 {
648+
if number, ok := ruleNum.(int); ok && number != 0 {
649649
// Validate only if rule_number is explicitly set (non-zero)
650-
if rId < 1 || rId > 65535 {
650+
if number < 1 || number > 65535 {
651651
return fmt.Errorf(
652-
"%q must be between %d and %d inclusive, got: %d", "rule_number", 1, 65535, rId)
652+
"%q must be between %d and %d inclusive, got: %d", "rule_number", 1, 65535, number)
653653
}
654654
}
655655
}

website/docs/r/network_acl_rule.html.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The following arguments are supported:
4848

4949
The `rule` block supports:
5050

51-
* `rule_number` - (Optional) The number of the ACL item, its ordering.
51+
* `rule_number` - (Optional) The number of the ACL item used to order the ACL rules. The ACL rule with the lowest number has the highest priority. If not specified, the ACL item will be created with a number one greater than the highest numbered rule.
5252

5353
* `action` - (Optional) The action for the rule. Valid options are: `allow` and
5454
`deny` (defaults allow).

0 commit comments

Comments
 (0)