junoser 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/example/vsrx-12.1.x47.rb +57 -18
- data/junoser.gemspec +0 -1
- data/lib/junoser/development.rb +1 -0
- data/lib/junoser/parser.rb +60 -22
- data/lib/junoser/ruler.rb +2 -0
- data/lib/junoser/version.rb +1 -1
- data/lib/junoser/xsd/element.rb +0 -1
- data/lib/junoser/xsd/parsable.rb +0 -1
- data/lib/underscorable.rb +15 -0
- metadata +4 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1712996f972e957b0606905fdad4a5e1888623d
|
|
4
|
+
data.tar.gz: 05fe617f94ace5f76847da3da6e950b6661bda4f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8055f567929e8499ceb8b2ace5415ab82526f82e76aee1bfd72fa56eca5972dda99374daf725c4de823c52b52faae1d7fcfd48523a6173f9536dcb35c7ec5c9b
|
|
7
|
+
data.tar.gz: 98733286e456322ce034ad6be647cb2d33f4d4481ecab034a7224284aac3a3f6d05237d7b292ad2f44ee3855bd18894b52f82bd90842e0ed84d2b8a2db2d26ad
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## 0.2.4 / 2017-02-18
|
|
2
|
+
|
|
3
|
+
* Newly supported syntax
|
|
4
|
+
* system processes app-engine-virtual-machine-management-service traceoptions
|
|
5
|
+
* Some platforms expect "system processes dhcp", not "system processes dhcp-service"
|
|
6
|
+
* "storm-control" under family bridge
|
|
7
|
+
* Bug fix
|
|
8
|
+
* Appropriately extract "vlan <vlan-name>"
|
|
9
|
+
|
|
1
10
|
## 0.2.3 / 2016-08-28
|
|
2
11
|
|
|
3
12
|
* Newly supported syntax
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/example/vsrx-12.1.x47.rb
CHANGED
|
@@ -1949,6 +1949,9 @@ rule(:configuration) do
|
|
|
1949
1949
|
),
|
|
1950
1950
|
c(
|
|
1951
1951
|
"isid-list" arg
|
|
1952
|
+
),
|
|
1953
|
+
"storm-control" (
|
|
1954
|
+
storm_control
|
|
1952
1955
|
)
|
|
1953
1956
|
)
|
|
1954
1957
|
),
|
|
@@ -6984,24 +6987,7 @@ rule(:ethernet_switching_type) do
|
|
|
6984
6987
|
)
|
|
6985
6988
|
),
|
|
6986
6989
|
"storm-control" (
|
|
6987
|
-
|
|
6988
|
-
"default",
|
|
6989
|
-
"action-shutdown",
|
|
6990
|
-
"interface" ("all" | "name") (
|
|
6991
|
-
c(
|
|
6992
|
-
"bandwidth" arg,
|
|
6993
|
-
"no-broadcast",
|
|
6994
|
-
"no-unknown-unicast",
|
|
6995
|
-
"level" arg,
|
|
6996
|
-
c(
|
|
6997
|
-
"multicast",
|
|
6998
|
-
"no-multicast",
|
|
6999
|
-
"no-registered-multicast",
|
|
7000
|
-
"no-unregistered-multicast"
|
|
7001
|
-
)
|
|
7002
|
-
)
|
|
7003
|
-
)
|
|
7004
|
-
)
|
|
6990
|
+
storm_control
|
|
7005
6991
|
)
|
|
7006
6992
|
)
|
|
7007
6993
|
end
|
|
@@ -10297,6 +10283,9 @@ rule(:interfaces_type) do
|
|
|
10297
10283
|
),
|
|
10298
10284
|
c(
|
|
10299
10285
|
"isid-list" arg
|
|
10286
|
+
),
|
|
10287
|
+
"storm-control" (
|
|
10288
|
+
storm_control
|
|
10300
10289
|
)
|
|
10301
10290
|
)
|
|
10302
10291
|
),
|
|
@@ -14649,6 +14638,9 @@ rule(:juniper_dynamic_profile_object) do
|
|
|
14649
14638
|
),
|
|
14650
14639
|
c(
|
|
14651
14640
|
"isid-list" arg
|
|
14641
|
+
),
|
|
14642
|
+
"storm-control" (
|
|
14643
|
+
storm_control
|
|
14652
14644
|
)
|
|
14653
14645
|
)
|
|
14654
14646
|
),
|
|
@@ -31267,6 +31259,29 @@ rule(:juniper_system) do
|
|
|
31267
31259
|
"disable"
|
|
31268
31260
|
)
|
|
31269
31261
|
)
|
|
31262
|
+
),
|
|
31263
|
+
"app-engine-virtual-machine-management-service" (
|
|
31264
|
+
c(
|
|
31265
|
+
"traceoptions" (
|
|
31266
|
+
c(
|
|
31267
|
+
"no-remote-trace",
|
|
31268
|
+
"file" (
|
|
31269
|
+
c(
|
|
31270
|
+
"filename" arg,
|
|
31271
|
+
"size" arg,
|
|
31272
|
+
"files" arg,
|
|
31273
|
+
"world-readable",
|
|
31274
|
+
"no-world-readable",
|
|
31275
|
+
"match" (
|
|
31276
|
+
regular_expression
|
|
31277
|
+
)
|
|
31278
|
+
)
|
|
31279
|
+
).as(:oneline),
|
|
31280
|
+
"level" arg,
|
|
31281
|
+
"flag" ("active-directory-authentication" | "configuration" | "db" | "ip-user-mapping" | "ip-user-probe" | "ipc" | "user-group-mapping" | "wmic" | "all").as(:oneline)
|
|
31282
|
+
)
|
|
31283
|
+
)
|
|
31284
|
+
)
|
|
31270
31285
|
)
|
|
31271
31286
|
)
|
|
31272
31287
|
),
|
|
@@ -32690,6 +32705,9 @@ rule(:lr_interfaces_type) do
|
|
|
32690
32705
|
),
|
|
32691
32706
|
c(
|
|
32692
32707
|
"isid-list" arg
|
|
32708
|
+
),
|
|
32709
|
+
"storm-control" (
|
|
32710
|
+
storm_control
|
|
32693
32711
|
)
|
|
32694
32712
|
)
|
|
32695
32713
|
),
|
|
@@ -38369,3 +38387,24 @@ rule(:service_nat_object) do
|
|
|
38369
38387
|
)
|
|
38370
38388
|
)
|
|
38371
38389
|
end
|
|
38390
|
+
|
|
38391
|
+
rule(:storm_control) do
|
|
38392
|
+
c(
|
|
38393
|
+
"default",
|
|
38394
|
+
"action-shutdown",
|
|
38395
|
+
"interface" ("all" | "name") (
|
|
38396
|
+
c(
|
|
38397
|
+
"bandwidth" arg,
|
|
38398
|
+
"no-broadcast",
|
|
38399
|
+
"no-unknown-unicast",
|
|
38400
|
+
"level" arg,
|
|
38401
|
+
c(
|
|
38402
|
+
"multicast",
|
|
38403
|
+
"no-multicast",
|
|
38404
|
+
"no-registered-multicast",
|
|
38405
|
+
"no-unregistered-multicast"
|
|
38406
|
+
)
|
|
38407
|
+
)
|
|
38408
|
+
)
|
|
38409
|
+
)
|
|
38410
|
+
end
|
data/junoser.gemspec
CHANGED
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.9"
|
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
|
25
|
-
spec.add_development_dependency "activesupport"
|
|
26
25
|
spec.add_development_dependency "nokogiri"
|
|
27
26
|
spec.add_development_dependency "test-unit"
|
|
28
27
|
end
|
data/lib/junoser/development.rb
CHANGED
data/lib/junoser/parser.rb
CHANGED
|
@@ -1995,6 +1995,9 @@ module Junoser
|
|
|
1995
1995
|
),
|
|
1996
1996
|
c(
|
|
1997
1997
|
a(str("isid-list"), arg)
|
|
1998
|
+
),
|
|
1999
|
+
b(str("storm-control"),
|
|
2000
|
+
storm_control
|
|
1998
2001
|
)
|
|
1999
2002
|
)
|
|
2000
2003
|
),
|
|
@@ -7010,24 +7013,7 @@ module Junoser
|
|
|
7010
7013
|
)
|
|
7011
7014
|
),
|
|
7012
7015
|
b(str("storm-control"),
|
|
7013
|
-
|
|
7014
|
-
str("default"),
|
|
7015
|
-
str("action-shutdown"),
|
|
7016
|
-
a(str("interface"), str("all") | arg,
|
|
7017
|
-
c(
|
|
7018
|
-
a(str("bandwidth"), arg),
|
|
7019
|
-
str("no-broadcast"),
|
|
7020
|
-
str("no-unknown-unicast"),
|
|
7021
|
-
a(str("level"), arg),
|
|
7022
|
-
c(
|
|
7023
|
-
str("multicast"),
|
|
7024
|
-
str("no-multicast"),
|
|
7025
|
-
str("no-registered-multicast"),
|
|
7026
|
-
str("no-unregistered-multicast")
|
|
7027
|
-
)
|
|
7028
|
-
)
|
|
7029
|
-
)
|
|
7030
|
-
)
|
|
7016
|
+
storm_control
|
|
7031
7017
|
)
|
|
7032
7018
|
)
|
|
7033
7019
|
end
|
|
@@ -10315,6 +10301,9 @@ module Junoser
|
|
|
10315
10301
|
),
|
|
10316
10302
|
c(
|
|
10317
10303
|
a(str("isid-list"), arg)
|
|
10304
|
+
),
|
|
10305
|
+
b(str("storm-control"),
|
|
10306
|
+
storm_control
|
|
10318
10307
|
)
|
|
10319
10308
|
)
|
|
10320
10309
|
),
|
|
@@ -14646,6 +14635,9 @@ module Junoser
|
|
|
14646
14635
|
),
|
|
14647
14636
|
c(
|
|
14648
14637
|
a(str("isid-list"), arg)
|
|
14638
|
+
),
|
|
14639
|
+
b(str("storm-control"),
|
|
14640
|
+
storm_control
|
|
14649
14641
|
)
|
|
14650
14642
|
)
|
|
14651
14643
|
),
|
|
@@ -16072,7 +16064,7 @@ module Junoser
|
|
|
16072
16064
|
str("persistent-learning")
|
|
16073
16065
|
)
|
|
16074
16066
|
),
|
|
16075
|
-
a(str("vlan"), str("all") |
|
|
16067
|
+
a(str("vlan"), str("all") | arg,
|
|
16076
16068
|
c(
|
|
16077
16069
|
c(
|
|
16078
16070
|
b(str("arp-inspection"),
|
|
@@ -24328,7 +24320,7 @@ module Junoser
|
|
|
24328
24320
|
).as(:oneline)
|
|
24329
24321
|
)
|
|
24330
24322
|
),
|
|
24331
|
-
a(str("vlan"), str("all") |
|
|
24323
|
+
a(str("vlan"), str("all") | arg,
|
|
24332
24324
|
c(
|
|
24333
24325
|
str("disable"),
|
|
24334
24326
|
a(str("version"), arg),
|
|
@@ -24954,7 +24946,7 @@ module Junoser
|
|
|
24954
24946
|
).as(:oneline)
|
|
24955
24947
|
)
|
|
24956
24948
|
),
|
|
24957
|
-
a(str("vlan"), str("all") |
|
|
24949
|
+
a(str("vlan"), str("all") | arg,
|
|
24958
24950
|
c(
|
|
24959
24951
|
str("disable"),
|
|
24960
24952
|
a(str("version"), arg),
|
|
@@ -30866,7 +30858,7 @@ module Junoser
|
|
|
30866
30858
|
)
|
|
30867
30859
|
)
|
|
30868
30860
|
),
|
|
30869
|
-
b(str("dhcp-service"),
|
|
30861
|
+
b((str("dhcp-service") | str("dhcp")),
|
|
30870
30862
|
c(
|
|
30871
30863
|
c(
|
|
30872
30864
|
str("disable")
|
|
@@ -31079,6 +31071,28 @@ module Junoser
|
|
|
31079
31071
|
str("disable")
|
|
31080
31072
|
)
|
|
31081
31073
|
)
|
|
31074
|
+
),
|
|
31075
|
+
b(str("app-engine-virtual-machine-management-service"),
|
|
31076
|
+
c(
|
|
31077
|
+
b(str("traceoptions"),
|
|
31078
|
+
c(
|
|
31079
|
+
str("no-remote-trace"),
|
|
31080
|
+
b(str("file"),
|
|
31081
|
+
sca(
|
|
31082
|
+
a(str("size"), arg),
|
|
31083
|
+
a(str("files"), arg),
|
|
31084
|
+
str("world-readable"),
|
|
31085
|
+
str("no-world-readable"),
|
|
31086
|
+
b(str("match"),
|
|
31087
|
+
regular_expression
|
|
31088
|
+
)
|
|
31089
|
+
)
|
|
31090
|
+
).as(:oneline),
|
|
31091
|
+
a(str("level"), arg),
|
|
31092
|
+
a(str("flag"), str("active-directory-authentication") | str("configuration") | str("db") | str("ip-user-mapping") | str("ip-user-probe") | str("ipc") | str("user-group-mapping") | str("wmic") | str("all")).as(:oneline)
|
|
31093
|
+
)
|
|
31094
|
+
)
|
|
31095
|
+
)
|
|
31082
31096
|
)
|
|
31083
31097
|
)
|
|
31084
31098
|
),
|
|
@@ -32486,6 +32500,9 @@ module Junoser
|
|
|
32486
32500
|
),
|
|
32487
32501
|
c(
|
|
32488
32502
|
a(str("isid-list"), arg)
|
|
32503
|
+
),
|
|
32504
|
+
b(str("storm-control"),
|
|
32505
|
+
storm_control
|
|
32489
32506
|
)
|
|
32490
32507
|
)
|
|
32491
32508
|
),
|
|
@@ -38145,5 +38162,26 @@ module Junoser
|
|
|
38145
38162
|
)
|
|
38146
38163
|
)
|
|
38147
38164
|
end
|
|
38165
|
+
|
|
38166
|
+
rule(:storm_control) do
|
|
38167
|
+
c(
|
|
38168
|
+
str("default"),
|
|
38169
|
+
str("action-shutdown"),
|
|
38170
|
+
a(str("interface"), str("all") | arg,
|
|
38171
|
+
c(
|
|
38172
|
+
a(str("bandwidth"), arg),
|
|
38173
|
+
str("no-broadcast"),
|
|
38174
|
+
str("no-unknown-unicast"),
|
|
38175
|
+
a(str("level"), arg),
|
|
38176
|
+
c(
|
|
38177
|
+
str("multicast"),
|
|
38178
|
+
str("no-multicast"),
|
|
38179
|
+
str("no-registered-multicast"),
|
|
38180
|
+
str("no-unregistered-multicast")
|
|
38181
|
+
)
|
|
38182
|
+
)
|
|
38183
|
+
)
|
|
38184
|
+
)
|
|
38185
|
+
end
|
|
38148
38186
|
end
|
|
38149
38187
|
end
|
data/lib/junoser/ruler.rb
CHANGED
|
@@ -49,10 +49,12 @@ module Junoser
|
|
|
49
49
|
|
|
50
50
|
str.gsub!(/\((.*) \| "name"\)/) { "(#$1 | arg)" }
|
|
51
51
|
str.gsub! '"vlan" ("id-name" | "all")', '"vlan" ("all" | arg)'
|
|
52
|
+
str.gsub! '"vlan" ("all" | "vlan-name")', '"vlan" ("all" | arg)'
|
|
52
53
|
str.gsub!(/("ssh-\S+") arg/) { "#$1 (quote | arg)" }
|
|
53
54
|
str.gsub! '"description" arg', '"description" (quote | arg)'
|
|
54
55
|
str.gsub! '"as-path-prepend" arg', '"as-path-prepend" (quote | arg)'
|
|
55
56
|
str.gsub! '"path-list" arg (', 'b(ipaddr,'
|
|
57
|
+
str.gsub! '"dhcp-service" (', '("dhcp-service" | "dhcp") ('
|
|
56
58
|
|
|
57
59
|
str.gsub!(/(s\(\s*)"address" arg/) { "#{$1}arg" }
|
|
58
60
|
str.gsub!(/^(\s*"idle-timeout" \(\s*c\(\s*c\(\s*"forever",\s*)"timeout" arg/) { "#{$1}arg" }
|
data/lib/junoser/version.rb
CHANGED
data/lib/junoser/xsd/element.rb
CHANGED
data/lib/junoser/xsd/parsable.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module Underscorable
|
|
2
|
+
# Port from activesupport-4.2.7.1/lib/active_support/inflector/methods.rb
|
|
3
|
+
def underscore
|
|
4
|
+
return self unless self =~ /[A-Z-]|::/
|
|
5
|
+
word = self.to_s.gsub(/::/, '/')
|
|
6
|
+
word.gsub!(/(?:(?<=([A-Za-z\d]))|\b)((?=a)b)(?=\b|[^a-z])/) { "#{$1 && '_'}#{$2.downcase}" }
|
|
7
|
+
word.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
|
|
8
|
+
word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
|
|
9
|
+
word.tr!("-", "_")
|
|
10
|
+
word.downcase!
|
|
11
|
+
word
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
String.include Underscorable
|
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.2.
|
|
4
|
+
version: 0.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Shintaro Kojima
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2017-02-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parslet
|
|
@@ -52,20 +52,6 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '10.0'
|
|
55
|
-
- !ruby/object:Gem::Dependency
|
|
56
|
-
name: activesupport
|
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
|
58
|
-
requirements:
|
|
59
|
-
- - ">="
|
|
60
|
-
- !ruby/object:Gem::Version
|
|
61
|
-
version: '0'
|
|
62
|
-
type: :development
|
|
63
|
-
prerelease: false
|
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
65
|
-
requirements:
|
|
66
|
-
- - ">="
|
|
67
|
-
- !ruby/object:Gem::Version
|
|
68
|
-
version: '0'
|
|
69
55
|
- !ruby/object:Gem::Dependency
|
|
70
56
|
name: nokogiri
|
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -135,6 +121,7 @@ files:
|
|
|
135
121
|
- lib/junoser/xsd/restriction.rb
|
|
136
122
|
- lib/junoser/xsd/sequence.rb
|
|
137
123
|
- lib/junoser/xsd/simple_content.rb
|
|
124
|
+
- lib/underscorable.rb
|
|
138
125
|
homepage: https://github.com/codeout/junoser
|
|
139
126
|
licenses: []
|
|
140
127
|
metadata: {}
|
|
@@ -154,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
141
|
version: '0'
|
|
155
142
|
requirements: []
|
|
156
143
|
rubyforge_project:
|
|
157
|
-
rubygems_version: 2.
|
|
144
|
+
rubygems_version: 2.6.8
|
|
158
145
|
signing_key:
|
|
159
146
|
specification_version: 4
|
|
160
147
|
summary: PEG parser for JUNOS configuration.
|