Skip to content

Commit

Permalink
Merge branch 'snmp-name'
Browse files Browse the repository at this point in the history
  • Loading branch information
codeout committed Oct 17, 2021
2 parents 8e292ba + 28520b7 commit 451d930
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/junoser/js_ruler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ def process_reserved_word(str)
str.gsub! 'policy | Define a policy context from this zone', 'from-zone | Define a policy context from this zone'
# "to-zone-name | Destination zone" -> "to-zone | Destination zone"
str.gsub! 'to-zone-name | Destination zone', 'to-zone | Destination zone'
# "system-name | System name override" -> "name | System name override"
str.gsub! 'system-name | System name override', 'name | System name override'

fix_route_filter(str)

Expand Down
4 changes: 2 additions & 2 deletions lib/junoser/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8746,7 +8746,7 @@ def enum(object)
).as(:oneline),
b(str("snmp"),
c(
a(str("system-name"), arg),
a(str("name"), quote | arg),
a(str("description"), quote | arg),
a(str("location"), quote | arg),
a(str("contact"), quote | arg),
Expand Down Expand Up @@ -14289,7 +14289,7 @@ def enum(object)
b(str("suppress-tlv-advertisement"),
(str("MANAGEMENT_ADDRESS") | str("SYSTEM_CAPABILITIES") | str("SYSTEM_DESCRIPTION") | str("SYSTEM_NAME") | str("PORT_DESCRIPTION") | str("PORT_ID") | str("CHASSIS_ID"))
),
a(str("system-name"), arg),
a(str("name"), quote | arg),
a(str("system-description"), arg),
a(str("chassis-id"), arg),
b(str("chassis-id-type"),
Expand Down
3 changes: 3 additions & 0 deletions lib/junoser/ruler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ def process_reserved_element(str)
str.gsub!(/"(dest|src|static)-nat-rule-match"/) { '"match"' }

str

# Fix .xsd: "snmp system-name" should be "snmp name"
str.gsub! '"system-name" arg', '"name" (quote | arg)'
end

def format(str, offset = OFFSET)
Expand Down
2 changes: 2 additions & 0 deletions test/test_valid_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class TestValidStatements < Test::Unit::TestCase
set snmp contact "foo bar"
set snmp location "foo bar"
set snmp name foo
set snmp name "foo bar"
set protocols bgp minimum-hold-time 10
set system dump-on-panic
Expand Down

0 comments on commit 451d930

Please sign in to comment.