Skip to content

Commit

Permalink
r/security_global_policy: fix error reading config
Browse files Browse the repository at this point in the history
when an element of permit_application_services have the suffix permit, deny or reject
Fix #430
  • Loading branch information
jeremmfr committed Oct 14, 2022
1 parent 27dd8a8 commit 751ccff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ 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)

## 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

0 comments on commit 751ccff

Please sign in to comment.