Skip to content

Commit

Permalink
Merge pull request #433 from jeremmfr/issue-430
Browse files Browse the repository at this point in the history
security_policy: fix error reading config when there is permit suffix in application-services
  • Loading branch information
jeremmfr authored Oct 14, 2022
2 parents c932050 + 4a01c77 commit 10b34c7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ ENHANCEMENTS:

BUG FIXES:

* resource/`junos_security_global_policy`: fix error reading config when an element of `permit_application_services` have the suffix `permit`, `deny` or `reject` (Fixes #430)
* resource/`junos_security_policy`: fix error reading config when an element of `permit_application_services` have the suffix `permit`, `deny` or `reject`

## 1.31.0 (October 12, 2022)

FEATURES:
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_security_global_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ func readSecurityGlobalPolicy(clt *Client, junSess *junosSession) (globalPolicyO
itemTrimPolicy, "match source-end-user-profile "), "\"")
case strings.HasPrefix(itemTrimPolicy, "then "):
switch {
case strings.HasSuffix(itemTrimPolicy, permitW),
strings.HasSuffix(itemTrimPolicy, "deny"),
strings.HasSuffix(itemTrimPolicy, "reject"):
case itemTrimPolicy == "then permit",
itemTrimPolicy == "then deny",
itemTrimPolicy == "then reject":
policy["then"] = strings.TrimPrefix(itemTrimPolicy, "then ")
case itemTrimPolicy == "then count":
policy["count"] = true
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_security_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ func readSecurityPolicy(fromZone, toZone string, clt *Client, junSess *junosSess
itemTrimPolicy, "match source-end-user-profile "), "\"")
case strings.HasPrefix(itemTrimPolicy, "then "):
switch {
case strings.HasSuffix(itemTrimPolicy, permitW),
strings.HasSuffix(itemTrimPolicy, "deny"),
strings.HasSuffix(itemTrimPolicy, "reject"):
case itemTrimPolicy == "then permit",
itemTrimPolicy == "then deny",
itemTrimPolicy == "then reject":
policy["then"] = strings.TrimPrefix(itemTrimPolicy, "then ")
case itemTrimPolicy == "then count":
policy["count"] = true
Expand Down

0 comments on commit 10b34c7

Please sign in to comment.