ohai 7.2.2 → 7.2.4

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
  SHA1:
3
- metadata.gz: 4329545c173368396f653fe483a8c05a0bbfcbf7
4
- data.tar.gz: 82c031fc26ba2f9fd0a1c0a91d68eb344c3d44f5
3
+ metadata.gz: 4a1d023b6ada45bf854a31175dc2619b818ad414
4
+ data.tar.gz: c8814f952653d4d0f575cf555000f5f78109621d
5
5
  SHA512:
6
- metadata.gz: eece99b024c9d7e9ee89cd3eaa6213f92bc39586a520e914226e9127f3368edf1c3b11c3d5756c14533742e778f2c0cc80cf951dc1632fe9616615274f140071
7
- data.tar.gz: 9c681cd6d5f724a472e8181d4924265edf463a7bc99ccf71f200fc9ca53c4208062e25a40d0f8f890eb6fdce31a423fc0a18e24d14506ceb08f3e5e50293b7c4
6
+ metadata.gz: 16f20dda963e4624a86939379bdbb17862d6c76fdaff24f608763105e07fda9beafffb3640d0cbc8fd74f301fbd1c401bf4f7766ea5eb88e922992b513b19c41
7
+ data.tar.gz: aa955999197d306f23741d20c0c961285fc5094bb34ac461a7c24b39f67598f7bb4c080366213594507aae2ac467b37cd387af47aed290e9e105ec85bab6ee80
@@ -200,12 +200,21 @@ Ohai.plugin(:Network) do
200
200
  # the routing table source field.
201
201
  # 3) and since we're at it, let's populate some :routes attributes
202
202
  # (going to do that for both inet and inet6 addresses)
203
- so = shell_out("ip -f #{family[:name]} route show")
203
+ so = shell_out("ip -o -f #{family[:name]} route show")
204
204
  so.stdout.lines do |line|
205
- if line =~ /^([^\s]+)\s(.*)$/
205
+ line.strip!
206
+ Ohai::Log.debug("Parsing #{line}")
207
+ if line =~ /\\/
208
+ parts = line.split('\\')
209
+ route_dest = parts.shift.strip
210
+ route_endings = parts
211
+ elsif line =~ /^([^\s]+)\s(.*)$/
206
212
  route_dest = $1
207
- route_ending = $2
208
- #
213
+ route_endings = [$2]
214
+ else
215
+ next
216
+ end
217
+ route_endings.each do |route_ending|
209
218
  if route_ending =~ /\bdev\s+([^\s]+)\b/
210
219
  route_int = $1
211
220
  else
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '7.2.2'
21
+ VERSION = '7.2.4'
22
22
  end
@@ -31,8 +31,8 @@ def do_stubs
31
31
  @plugin.stub(:shell_out).with("ip -d -s link").and_return(mock_shell_out(0, @linux_ip_link_s_d, ""))
32
32
  @plugin.stub(:shell_out).with("ip -f inet neigh show").and_return(mock_shell_out(0, @linux_ip_neighbor_show, ""))
33
33
  @plugin.stub(:shell_out).with("ip -f inet6 neigh show").and_return(mock_shell_out(0, @linux_ip_inet6_neighbor_show, ""))
34
- @plugin.stub(:shell_out).with("ip -f inet route show").and_return(mock_shell_out(0, @linux_ip_route, ""))
35
- @plugin.stub(:shell_out).with("ip -f inet6 route show").and_return(mock_shell_out(0, @linux_ip_route_inet6, ""))
34
+ @plugin.stub(:shell_out).with("ip -o -f inet route show").and_return(mock_shell_out(0, @linux_ip_route, ""))
35
+ @plugin.stub(:shell_out).with("ip -o -f inet6 route show").and_return(mock_shell_out(0, @linux_ip_route_inet6, ""))
36
36
  @plugin.stub(:shell_out).with("route -n").and_return(mock_shell_out(0, @linux_route_n, ""))
37
37
  @plugin.stub(:shell_out).with("ifconfig -a").and_return(mock_shell_out(0, @linux_ifconfig, ""))
38
38
  @plugin.stub(:shell_out).with("arp -an").and_return(mock_shell_out(0, @linux_arp_an, ""))
@@ -245,6 +245,7 @@ NEIGHBOR_SHOW
245
245
  192.168.212.0/24 dev foo:veth0@eth0 proto kernel src 192.168.212.2
246
246
  172.16.151.0/24 dev eth0 proto kernel src 172.16.151.100
247
247
  192.168.0.0/24 dev eth0 proto kernel src 192.168.0.2
248
+ 10.5.4.0/24 \\ nexthop via 10.5.4.1 dev eth0 weight 1\\ nexthop via 10.5.4.2 dev eth0 weight 1
248
249
  default via 10.116.201.1 dev eth0
249
250
  IP_ROUTE_SCOPE
250
251
 
@@ -555,6 +556,8 @@ ROUTE_N
555
556
  it "adds routes" do
556
557
  @plugin.run
557
558
  @plugin['network']['interfaces']['eth0']['routes'].should include Mash.new( :destination => "10.116.201.0/24", :proto => "kernel", :family =>"inet" )
559
+ @plugin['network']['interfaces']['eth0']['routes'].should include Mash.new( :destination => "10.5.4.0/24", :family =>"inet", :via => "10.5.4.1")
560
+ @plugin['network']['interfaces']['eth0']['routes'].should include Mash.new( :destination => "10.5.4.0/24", :family =>"inet", :via => "10.5.4.2")
558
561
  @plugin['network']['interfaces']['foo:veth0@eth0']['routes'].should include Mash.new( :destination => "192.168.212.0/24", :proto => "kernel", :src => "192.168.212.2", :family =>"inet" )
559
562
  @plugin['network']['interfaces']['eth0']['routes'].should include Mash.new( :destination => "fe80::/64", :metric => "256", :proto => "kernel", :family => "inet6" )
560
563
  @plugin['network']['interfaces']['eth0.11']['routes'].should include Mash.new( :destination => "1111:2222:3333:4444::/64", :metric => "1024", :family => "inet6" )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.2.2
4
+ version: 7.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-15 00:00:00.000000000 Z
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types