junoser 0.5.3 → 0.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4241a7b2a24ab7118dae491d2538107fdfa0b4a0f8f4fe701e713a00197a424c
4
- data.tar.gz: fba378b8cf21dc3ffc554c20ad6b0650844546b54defbe6f1fec15cea6294182
3
+ metadata.gz: bd8a2424c80ebdcb0ed5600ad8288c998200c086d77959e54e06ef64d454e34d
4
+ data.tar.gz: b5f2f4bcfd79fc44c64847b3ee5d56ae908711b704451250ef7e26943cf059ae
5
5
  SHA512:
6
- metadata.gz: 3283f8dfa5972d2ca4bdd25abc0b6c30d9b41266afb6a4ac31b6e9144c46b1adc1e4d03af939fb0ebce2a2e42b57197acaaf38c81005ffe7b1b66df75e42bef0
7
- data.tar.gz: a626b7bd44f66b3cc9606a23a4342b5101deedd75f8df70eac66afa87d695971bb598a9546a50d83fea4115a9974cd23c78381a0a76e337d914facab8a8c3ebd
6
+ metadata.gz: 95a0151dabc6e3b9a1c3c82c1e97cd9fe64546bfc2ca858767ce539fdade394b6b1b9891753a2fcdcf1a261754933c047f37e2d20f9d913beff5dd8c73cf313d
7
+ data.tar.gz: 487285a5986e28319c1ce38fe64573402e662fad33791d049eff9781b2c140474fb02d819d2151f3e76fb84d553a779446dac48d9ae5428d1dcff1d10c785971
data/CHANGELOG.md CHANGED
@@ -1,3 +1,25 @@
1
+ ## [0.5.5] - 2023-11-14
2
+
3
+ ### Fixed
4
+
5
+ * junoser-squash unexpectedly removed non-idential lines
6
+
7
+
8
+ ## [0.5.4] - 2023-07-15
9
+
10
+ ### Added
11
+
12
+ * Newly supported syntax
13
+ * "chassis dump-on-panic"
14
+
15
+ ### Fixed
16
+
17
+ * "policy-options policy-statement xxx from policy" didn't accept `[ ... ]` or `( ... )` expressions
18
+ * "system no-redirects-ipv6" was unexpectedly marked as invalid
19
+ * "snmp trap-group xxx categories chassis-cluster" was unexpectedly marked as invalid
20
+ * error when parsing "class-of-service schedulers foo drop-profile-map ..."
21
+
22
+
1
23
  ## [0.5.3] - 2023-07-10
2
24
 
3
25
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- junoser (0.5.3)
4
+ junoser (0.5.5)
5
5
  parslet
6
6
 
7
7
  GEM
@@ -180,7 +180,7 @@ module Junoser
180
180
  end
181
181
 
182
182
  rule(:policy_algebra) do
183
- arg.as(:arg)
183
+ any.as(:arg)
184
184
  end
185
185
 
186
186
  rule(:regular_expression) do
@@ -9575,7 +9575,7 @@ module Junoser
9575
9575
  b(str("categories"),
9576
9576
  c(
9577
9577
  str("authentication"),
9578
- str("chassis"),
9578
+ str("chassis-ha-reswatch"),
9579
9579
  str("link"),
9580
9580
  str("remote-operations"),
9581
9581
  str("routing"),
@@ -9587,7 +9587,7 @@ module Junoser
9587
9587
  str("services"),
9588
9588
  str("chassis-cluster"),
9589
9589
  str("chassis-high-availability"),
9590
- str("chassis-ha-reswatch"),
9590
+ str("chassis"),
9591
9591
  str("timing-events"),
9592
9592
  str("dot3oam-events"),
9593
9593
  b(str("sonet-alarms"),
@@ -22386,6 +22386,7 @@ module Junoser
22386
22386
  str("vlan-isolation")
22387
22387
  )
22388
22388
  ),
22389
+ str("dump-on-panic"),
22389
22390
  # Ported from vSRX 18.3R1.9
22390
22391
  b(str("cluster"),
22391
22392
  c(
@@ -45007,15 +45008,15 @@ module Junoser
45007
45008
  a(str("priority"), arg),
45008
45009
  a(str("excess-priority"), arg),
45009
45010
  b(str("drop-profile-map"),
45010
- s(
45011
- b(str("loss-priority"),
45012
- (str("low") | str("high") | str("medium-low") | str("medium-high") | str("any"))
45011
+ s(
45012
+ s(str("loss-priority"),
45013
+ (str("low") | str("high") | str("medium-low") | str("medium-high") | str("any"))
45013
45014
  ),
45014
- b(str("protocol"),
45015
- (str("tcp") | str("non-tcp") | str("any"))
45015
+ s(str("protocol"),
45016
+ (str("tcp") | str("non-tcp") | str("any"))
45016
45017
  ),
45017
- c(
45018
- a(str("drop-profile"), arg)
45018
+ s(str("drop-profile"),
45019
+ arg
45019
45020
  )
45020
45021
  )
45021
45022
  ).as(:oneline),
@@ -83449,8 +83450,8 @@ module Junoser
83449
83450
  str("no-neighbor-learn"),
83450
83451
  str("no-multicast-echo"),
83451
83452
  str("extended-echo"),
83452
- str("no-redirects"),
83453
83453
  str("no-redirects-ipv6"),
83454
+ str("no-redirects"),
83454
83455
  str("nd-override-preferred-src"),
83455
83456
  str("no-ping-record-route"),
83456
83457
  str("no-ping-time-stamp"),
data/lib/junoser/ruler.rb CHANGED
@@ -96,6 +96,19 @@ module Junoser
96
96
  'prefix_list_items'], $1)
97
97
  end
98
98
 
99
+ str.gsub!(/^(\s*)"drop-profile-map" \(\s*s\(\s*"loss-priority" \(\s*(.*\s*\),)\s*"protocol" \(\s*(.*\s*\),)\s*c\(\s*"drop-profile" (.*)/) do
100
+ format([
101
+ '"drop-profile-map" (',
102
+ ' s(',
103
+ ' s("loss-priority",',
104
+ " #{$2}",
105
+ ' s("protocol",',
106
+ " #{$3}",
107
+ ' s("drop-profile",',
108
+ " #{$4}"
109
+ ], $1)
110
+ end
111
+
99
112
  #
100
113
  # "arg" matches anything so move to the end
101
114
  #
@@ -138,6 +151,8 @@ module Junoser
138
151
  str.gsub!(/"snmp"(.*\s*.*)"snmptrap"/) { %["snmptrap"#{$1}"snmp"] }
139
152
  str.gsub!(/"ospf"(.*\s*.*)"ospf3"/) { %["ospf3"#{$1}"ospf"] }
140
153
  str.gsub!(/"deny"(.*\s*.*)"deny-password"/) { %["deny-password"#{$1}"deny"] }
154
+ str.gsub!(/"no-redirects"(.*\s*.*)"no-redirects-ipv6"/) { %["no-redirects-ipv6"#{$1}"no-redirects"] }
155
+ str.gsub!(/"chassis"([^()]*)"chassis-ha-reswatch"/m) { %["chassis-ha-reswatch"#{$1}"chassis"] }
141
156
  str.gsub! '"tls1" | "tls11" | "tls12"', '"tls11" | "tls12" | "tls1"'
142
157
  str.gsub!(/("group1" \| "group2" \| "group5") \| ([^)]+)/) { "#{$2} | #{$1}" }
143
158
 
@@ -252,6 +267,9 @@ module Junoser
252
267
  # Fix .xsd: support "set interfaces xxx ether-options speed"
253
268
  str.gsub! '"ethernet-1', '"1'
254
269
 
270
+ # Fix .xsd: support "set policy-options policy-statement xxx from policy [expression]"
271
+ str.gsub!(/^rule\(:policy_algebra\) do(\s*)arg\.as\(:arg\)\send/) { "rule(:policy_algebra) do#{$1}any.as(:arg)\nend" }
272
+
255
273
  str
256
274
  end
257
275
 
@@ -29,16 +29,18 @@ module Junoser
29
29
  end
30
30
 
31
31
  @lines.uniq!
32
- remove_subcommand(@lines).map(&:strip).join("\n")
32
+ remove_command_context(@lines).map(&:strip).join("\n")
33
33
  end
34
34
 
35
35
  private
36
36
 
37
- def remove_subcommand(lines)
37
+ def remove_command_context(lines)
38
38
  lines.each_with_index do |l, i|
39
39
  lines[i..-1].each do |l2|
40
- if l.include?(l2) and l != l2
41
- lines.delete(l2)
40
+ if l2[-1] == " " # l2 is a command context
41
+ lines.delete(l2) if l.include?(l2) and l != l2
42
+ else # l2 has argument
43
+ lines.delete(l2) if l.include?("#{l2} ")
42
44
  end
43
45
  end
44
46
  end
@@ -1,3 +1,3 @@
1
1
  module Junoser
2
- VERSION = "0.5.3"
2
+ VERSION = "0.5.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: junoser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shintaro Kojima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-10 00:00:00.000000000 Z
11
+ date: 2023-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet