specinfra 2.11.4 → 2.11.5
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/lib/specinfra/command/base/routing_table.rb +1 -1
- data/lib/specinfra/processor.rb +28 -6
- data/lib/specinfra/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 705f64c5443fd691f24ab9abb7ba9fa16f130db6
|
4
|
+
data.tar.gz: 6431a874a82046901a43ed5e4e9e56afd4cd8dff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e58430ecb3ffee31460c561918bdc03517138adaeab30ef2eb19548123b660bd90e452d996204adea5a4250c0d3f30d19e2569144c90dfee9519c8abcc7b97c
|
7
|
+
data.tar.gz: d76edde501300a5cbdf0efc423bd84dc275cd9ae4cfea2f3941ad81e504ca01a451f2ff4b5f3600ad5331acff69277a42661cb4e132ef1003031af44d2b9ace8
|
data/lib/specinfra/processor.rb
CHANGED
@@ -133,12 +133,34 @@ module Specinfra
|
|
133
133
|
:interface => expected_attr[:interface] ? $3 : nil
|
134
134
|
}
|
135
135
|
else
|
136
|
-
ret.stdout
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
136
|
+
matches = ret.stdout.scan(/^(\S+)(?: via (\S+))? dev (\S+).+\n|^(\S+).+\n|\s+nexthop via (\S+)\s+dev (\S+).+/)
|
137
|
+
if matches.length > 1
|
138
|
+
# ECMP route
|
139
|
+
destination = nil
|
140
|
+
matches.each do |groups|
|
141
|
+
if groups[3]
|
142
|
+
destination = groups[3]
|
143
|
+
next
|
144
|
+
else
|
145
|
+
next unless expected_attr[:interface] == groups[5]
|
146
|
+
end
|
147
|
+
|
148
|
+
actual_attr = {
|
149
|
+
:destination => destination,
|
150
|
+
:gateway => groups[4],
|
151
|
+
:interface => groups[5]
|
152
|
+
}
|
153
|
+
end
|
154
|
+
elsif matches.length == 1
|
155
|
+
# Non-ECMP route
|
156
|
+
groups = matches[0]
|
157
|
+
actual_attr = {
|
158
|
+
:destination => groups[0],
|
159
|
+
:gateway => groups[1] ? groups[1] : groups[3],
|
160
|
+
:interface => expected_attr[:interface] ? groups[2] : nil
|
161
|
+
}
|
162
|
+
end
|
163
|
+
|
142
164
|
end
|
143
165
|
|
144
166
|
expected_attr.each do |key, val|
|
data/lib/specinfra/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: specinfra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.11.
|
4
|
+
version: 2.11.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gosuke Miyashita
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|