Skip to content

Commit 85c3662

Browse files
committed
Merge branch 'snmp-name'
2 parents 8e292ba + 6157731 commit 85c3662

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

lib/junoser/js_ruler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ def process_reserved_word(str)
168168
str.gsub! 'policy | Define a policy context from this zone', 'from-zone | Define a policy context from this zone'
169169
# "to-zone-name | Destination zone" -> "to-zone | Destination zone"
170170
str.gsub! 'to-zone-name | Destination zone', 'to-zone | Destination zone'
171+
# "system-name | System name override" -> "name | System name override"
172+
str.gsub! 'system-name | System name override', 'name | System name override'
171173

172174
fix_route_filter(str)
173175

lib/junoser/parser.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8746,7 +8746,7 @@ def enum(object)
87468746
).as(:oneline),
87478747
b(str("snmp"),
87488748
c(
8749-
a(str("system-name"), arg),
8749+
a(str("name"), quote | arg),
87508750
a(str("description"), quote | arg),
87518751
a(str("location"), quote | arg),
87528752
a(str("contact"), quote | arg),
@@ -14289,7 +14289,7 @@ def enum(object)
1428914289
b(str("suppress-tlv-advertisement"),
1429014290
(str("MANAGEMENT_ADDRESS") | str("SYSTEM_CAPABILITIES") | str("SYSTEM_DESCRIPTION") | str("SYSTEM_NAME") | str("PORT_DESCRIPTION") | str("PORT_ID") | str("CHASSIS_ID"))
1429114291
),
14292-
a(str("system-name"), arg),
14292+
a(str("name"), quote | arg),
1429314293
a(str("system-description"), arg),
1429414294
a(str("chassis-id"), arg),
1429514295
b(str("chassis-id-type"),

lib/junoser/ruler.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ def process_reserved_element(str)
221221
str.gsub!(/"(dest|src|static)-nat-rule-match"/) { '"match"' }
222222

223223
str
224+
225+
# Fix .xsd: "snmp system-name" should be "snmp name"
226+
str.gsub! '"system-name" arg', '"name" (quote | arg)'
224227
end
225228

226229
def format(str, offset = OFFSET)

test/test_valid_statements.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class TestValidStatements < Test::Unit::TestCase
8989
9090
set snmp contact "foo bar"
9191
set snmp location "foo bar"
92+
set snmp name foo
93+
set snmp name "foo bar"
9294
9395
set protocols bgp minimum-hold-time 10
9496
set system dump-on-panic

0 commit comments

Comments
 (0)