ohai 0.6.12.rc.3 → 0.6.12.rc.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -45,6 +45,11 @@ end
45
45
  iface = Mash.new
46
46
  net_counters = Mash.new
47
47
 
48
+ # Match the lead line for an interface from iproute2
49
+ # 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
50
+ # The '@eth0:' portion doesn't exist on primary interfaces and thus is optional in the regex
51
+ IPROUTE_INT_REGEX = /^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z]+|):\s/
52
+
48
53
  if File.exist?("/sbin/ip")
49
54
 
50
55
  begin
@@ -64,7 +69,7 @@ if File.exist?("/sbin/ip")
64
69
  stdin.close
65
70
  cint = nil
66
71
  stdout.each do |line|
67
- if line =~ /^(\d+): ([0-9a-zA-Z\.\-_]+):\s/
72
+ if line =~ IPROUTE_INT_REGEX
68
73
  cint = $2
69
74
  iface[cint] = Mash.new
70
75
  if cint =~ /^(\w+)(\d+.*)/
@@ -89,9 +94,20 @@ if File.exist?("/sbin/ip")
89
94
  end
90
95
  end
91
96
  if line =~ /inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\/(\d{1,2}))?/
92
- iface[cint][:addresses] = Mash.new unless iface[cint][:addresses]
93
97
  tmp_addr, tmp_prefix = $1, $3
94
98
  tmp_prefix ||= "32"
99
+ original_int = nil
100
+
101
+ # Are we a formerly aliased interface?
102
+ if line =~ /#{cint}:(\d+)$/
103
+ sub_int = $1
104
+ alias_int = "#{cint}:#{sub_int}"
105
+ original_int = cint
106
+ cint = alias_int
107
+ end
108
+
109
+ iface[cint] = Mash.new unless iface[cint] # Create the fake alias interface if needed
110
+ iface[cint][:addresses] = Mash.new unless iface[cint][:addresses]
95
111
  iface[cint][:addresses][tmp_addr] = { "family" => "inet", "prefixlen" => tmp_prefix }
96
112
  iface[cint][:addresses][tmp_addr][:netmask] = IPAddr.new("255.255.255.255").mask(tmp_prefix.to_i).to_s
97
113
 
@@ -106,6 +122,9 @@ if File.exist?("/sbin/ip")
106
122
  if line =~ /scope (\w+)/
107
123
  iface[cint][:addresses][tmp_addr][:scope] = ($1.eql?("host") ? "Node" : $1.capitalize)
108
124
  end
125
+
126
+ # If we found we were an an alias interface, restore cint to its original value
127
+ cint = original_int unless original_int.nil?
109
128
  end
110
129
  if line =~ /inet6 ([a-f0-9\:]+)\/(\d+) scope (\w+)/
111
130
  iface[cint][:addresses] = Mash.new unless iface[cint][:addresses]
@@ -115,12 +134,12 @@ if File.exist?("/sbin/ip")
115
134
  end
116
135
  end
117
136
 
118
- popen4("ip -s link") do |pid, stdin, stdout, stderr|
137
+ popen4("ip -d -s link") do |pid, stdin, stdout, stderr|
119
138
  stdin.close
120
139
  tmp_int = nil
121
140
  on_rx = true
122
141
  stdout.each do |line|
123
- if line =~ /^(\d+): ([0-9a-zA-Z\.\-_]+):\s/
142
+ if line =~ IPROUTE_INT_REGEX
124
143
  tmp_int = $2
125
144
  net_counters[tmp_int] = Mash.new unless net_counters[tmp_int]
126
145
  end
@@ -147,6 +166,22 @@ if File.exist?("/sbin/ip")
147
166
  net_counters[tmp_int][:tx][:queuelen] = $1
148
167
  end
149
168
 
169
+ if line =~ /vlan id (\d+)/
170
+ tmp_id = $1
171
+ iface[tmp_int][:vlan] = Mash.new unless iface[tmp_int][:vlan]
172
+ iface[tmp_int][:vlan][:id] = tmp_id
173
+
174
+ vlan_flags = line.scan(/(REORDER_HDR|GVRP|LOOSE_BINDING)/)
175
+ if vlan_flags.length > 0
176
+ iface[tmp_int][:vlan][:flags] = vlan_flags.flatten.uniq
177
+ end
178
+ end
179
+
180
+ if line =~ /state (\w+)/
181
+ iface[tmp_int]['state'] = $1.downcase
182
+ end
183
+
184
+
150
185
  end
151
186
  end
152
187
 
@@ -175,7 +210,9 @@ else
175
210
  cint = nil
176
211
  stdout.each do |line|
177
212
  tmp_addr = nil
178
- if line =~ /^([0-9a-zA-Z\.\:\-_]+)\s+/
213
+ # dev_valid_name in the kernel only excludes slashes, nulls, spaces
214
+ # http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=blob;f=net/core/dev.c#l851
215
+ if line =~ /^([0-9a-zA-Z@\.\:\-_]+)\s+/
179
216
  cint = $1
180
217
  iface[cint] = Mash.new
181
218
  if cint =~ /^(\w+)(\d+.*)/
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = '0.6.12.rc.3'
21
+ VERSION = '0.6.12.rc.4'
22
22
  end
23
23
 
@@ -39,6 +39,49 @@ eth0 Link encap:Ethernet HWaddr 12:31:3D:02:BE:A2
39
39
  RX bytes:1392844460 (1.2 GiB) TX bytes:691785313 (659.7 MiB)
40
40
  Interrupt:16
41
41
 
42
+ eth0:5 Link encap:Ethernet HWaddr 00:0c:29:41:71:45
43
+ inet addr:192.168.5.1 Bcast:192.168.5.255 Mask:255.255.255.0
44
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
45
+
46
+ eth0.11 Link encap:Ethernet HWaddr 00:aa:bb:cc:dd:ee
47
+ inet addr:192.168.0.16 Bcast:192.168.0.255 Mask:255.255.255.0
48
+ inet6 addr: fe80::2aa:bbff:fecc:ddee/64 Scope:Link
49
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
50
+ RX packets:1208795008 errors:0 dropped:0 overruns:0 frame:0
51
+ TX packets:3269635153 errors:0 dropped:0 overruns:0 carrier:0
52
+ collisions:0 txqueuelen:0
53
+ RX bytes:1751940374 (1.6 GiB) TX bytes:2195567597 (2.0 GiB)
54
+
55
+ eth0.151 Link encap:Ethernet HWaddr 00:aa:bb:cc:dd:ee
56
+ inet addr:10.151.0.16 Bcast:10.151.0.255 Mask:255.255.255.0
57
+ inet6 addr: fe80::2aa:bbff:fecc:ddee/64 Scope:Link
58
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
59
+ RX packets:206553677 errors:0 dropped:0 overruns:0 frame:0
60
+ TX packets:163901336 errors:0 dropped:0 overruns:0 carrier:0
61
+ collisions:0 txqueuelen:0
62
+ RX bytes:3190792261 (2.9 GiB) TX bytes:755086548 (720.1 MiB)
63
+
64
+ eth0.152 Link encap:Ethernet HWaddr 00:aa:bb:cc:dd:ee
65
+ inet addr:10.152.1.16 Bcast:10.152.3.255 Mask:255.255.252.0
66
+ inet6 addr: fe80::2aa:bbff:fecc:ddee/64 Scope:Link
67
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
68
+ RX packets:14016741 errors:0 dropped:0 overruns:0 frame:0
69
+ TX packets:55232 errors:0 dropped:0 overruns:0 carrier:0
70
+ collisions:0 txqueuelen:0
71
+ RX bytes:664957462 (634.1 MiB) TX bytes:4876434 (4.6 MiB)
72
+
73
+ eth0.153 Link encap:Ethernet HWaddr 00:aa:bb:cc:dd:ee
74
+ inet addr:10.153.1.16 Bcast:10.153.3.255 Mask:255.255.252.0
75
+ inet6 addr: fe80::2aa:bbff:fecc:ddee/64 Scope:Link
76
+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
77
+ RX packets:2022667595 errors:0 dropped:0 overruns:0 frame:0
78
+ TX packets:1798627472 errors:0 dropped:0 overruns:0 carrier:0
79
+ collisions:0 txqueuelen:0
80
+ RX bytes:4047036732 (3.7 GiB) TX bytes:3451231474 (3.2 GiB)
81
+
82
+ foo:veth0@eth0 Link encap:Ethernet HWaddr ca:b3:73:8b:0c:e4
83
+ BROADCAST MULTICAST MTU:1500 Metric:1
84
+
42
85
  lo Link encap:Local Loopback
43
86
  inet addr:127.0.0.1 Mask:255.0.0.0
44
87
  inet6 addr: ::1/128 Scope:Host
@@ -48,6 +91,8 @@ lo Link encap:Local Loopback
48
91
  collisions:0 txqueuelen:0
49
92
  RX bytes:35224 (34.3 KiB) TX bytes:35224 (34.3 KiB)
50
93
  ENDIFCONFIG
94
+ # Note that ifconfig shows foo:veth0@eth0 but fails to show any address information.
95
+ # This was not a mistake collecting the output and Apparently ifconfig is broken in this regard.
51
96
 
52
97
  linux_ip_addr = <<-IP_ADDR
53
98
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
@@ -60,11 +105,36 @@ ENDIFCONFIG
60
105
  inet 10.116.201.76/24 brd 10.116.201.255 scope global eth0
61
106
  inet 10.116.201.75/32 scope global eth0
62
107
  inet 10.116.201.74/24 scope global secondary eth0
108
+ inet 192.168.5.1/24 brd 192.168.5.255 scope global eth0:5
63
109
  inet6 fe80::1031:3dff:fe02:bea2/64 scope link
64
110
  valid_lft forever preferred_lft forever
111
+ 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
112
+ link/ether 00:aa:bb:cc:dd:ee brd ff:ff:ff:ff:ff:ff
113
+ inet 192.168.0.16/24 brd 192.168.0.255 scope global eth0.11
114
+ inet6 fe80::2e0:81ff:fe2b:48e7/64 scope link
115
+ valid_lft forever preferred_lft forever
116
+ 4: eth0.151@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
117
+ link/ether 00:aa:bb:cc:dd:ee brd ff:ff:ff:ff:ff:ff
118
+ inet 10.151.0.16/24 brd 10.151.0.255 scope global eth0.151
119
+ inet 10.151.1.16/24 scope global eth0.151
120
+ inet6 fe80::2e0:81ff:fe2b:48e7/64 scope link
121
+ valid_lft forever preferred_lft forever
122
+ 5: eth0.152@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
123
+ link/ether 00:aa:bb:cc:dd:ee brd ff:ff:ff:ff:ff:ff
124
+ inet 10.152.1.16/22 brd 10.152.3.255 scope global eth0.152
125
+ inet6 fe80::2e0:81ff:fe2b:48e7/64 scope link
126
+ valid_lft forever preferred_lft forever
127
+ 6: eth0.153@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
128
+ link/ether 00:aa:bb:cc:dd:ee brd ff:ff:ff:ff:ff:ff
129
+ inet 10.153.1.16/22 brd 10.153.3.255 scope global eth0.153
130
+ inet6 fe80::2e0:81ff:fe2b:48e7/64 scope link
131
+ valid_lft forever preferred_lft forever
132
+ 7: foo:veth0@eth0@veth0: <BROADCAST,MULTICAST,M-DOWN> mtu 1500 qdisc noop state DOWN
133
+ link/ether ca:b3:73:8b:0c:e4 brd ff:ff:ff:ff:ff:ff
134
+ inet 192.168.212.2/24 scope global foo:veth0@eth0
65
135
  IP_ADDR
66
136
 
67
- linux_ip_link_s = <<-IP_LINK_S
137
+ linux_ip_link_s_d = <<-IP_LINK_S
68
138
  1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
69
139
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
70
140
  RX: bytes packets errors dropped overrun mcast
@@ -77,6 +147,13 @@ IP_ADDR
77
147
  1392844460 2659966 0 0 0 0
78
148
  TX: bytes packets errors dropped carrier collsns
79
149
  691785313 1919690 0 0 0 0
150
+ 3: eth0.11@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
151
+ link/ether 00:0c:29:41:71:45 brd ff:ff:ff:ff:ff:ff
152
+ vlan id 11 <REORDER_HDR>
153
+ RX: bytes packets errors dropped overrun mcast
154
+ 0 0 0 0 0 0
155
+ TX: bytes packets errors dropped carrier collsns
156
+ 0 0 0 0 0 0
80
157
  IP_LINK_S
81
158
 
82
159
  linux_route_n = <<-ROUTE_N
@@ -109,7 +186,7 @@ IP_ROUTE
109
186
  @route_lines = linux_route_n.split("\n")
110
187
  @arp_lines = linux_arp_an.split("\n")
111
188
  @ipaddr_lines = linux_ip_addr.split("\n")
112
- @iplink_lines = linux_ip_link_s.split("\n")
189
+ @iplink_lines = linux_ip_link_s_d.split("\n")
113
190
  @ipneighbor_lines = linux_ip_neighbor_show.split("\n")
114
191
  @iproute_lines = linux_ip_route_show_exact
115
192
 
@@ -131,7 +208,7 @@ IP_ROUTE
131
208
  @ohai.stub!(:popen4).with("arp -an").and_yield(nil, @stdin_arp, @arp_lines, nil)
132
209
  @ohai.stub!(:popen4).with("ip neighbor show").and_yield(nil, @stdin_ipneighbor, @ipneighbor_lines, nil)
133
210
  @ohai.stub!(:popen4).with("ip addr").and_yield(nil, @stdin_ipaddr, @ipaddr_lines, nil)
134
- @ohai.stub!(:popen4).with("ip -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
211
+ @ohai.stub!(:popen4).with("ip -d -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
135
212
  @ohai._require_plugin("network")
136
213
  @ohai._require_plugin("linux::network")
137
214
  end
@@ -141,7 +218,7 @@ IP_ROUTE
141
218
  end
142
219
 
143
220
  it "detects the interfaces" do
144
- @ohai['network']['interfaces'].keys.sort.should == ["eth0", "lo"]
221
+ @ohai['network']['interfaces'].keys.sort.should == ["eth0", "eth0.11", "eth0.151", "eth0.152", "eth0.153", "eth0:5", "foo:veth0@eth0", "lo"]
145
222
  end
146
223
 
147
224
  it "detects the ipv4 addresses of the ethernet interface" do
@@ -151,6 +228,13 @@ IP_ROUTE
151
228
  @ohai['network']['interfaces']['eth0']['addresses']['10.116.201.76']['family'].should == 'inet'
152
229
  end
153
230
 
231
+ it "detects the ipv4 addresses of an ethernet subinterface" do
232
+ @ohai['network']['interfaces']['eth0.11']['addresses'].keys.should include('192.168.0.16')
233
+ @ohai['network']['interfaces']['eth0.11']['addresses']['192.168.0.16']['netmask'].should == '255.255.255.0'
234
+ @ohai['network']['interfaces']['eth0.11']['addresses']['192.168.0.16']['broadcast'].should == '192.168.0.255'
235
+ @ohai['network']['interfaces']['eth0.11']['addresses']['192.168.0.16']['family'].should == 'inet'
236
+ end
237
+
154
238
  it "detects the ipv6 addresses of the ethernet interface" do
155
239
  @ohai['network']['interfaces']['eth0']['addresses'].keys.should include('fe80::1031:3dff:fe02:bea2')
156
240
  @ohai['network']['interfaces']['eth0']['addresses']['fe80::1031:3dff:fe02:bea2']['scope'].should == 'Link'
@@ -228,7 +312,7 @@ IP_ROUTE
228
312
  @ohai.stub!(:popen4).with("arp -an").and_yield(nil, @stdin_arp, @arp_lines, nil)
229
313
  @ohai.stub!(:popen4).with("ip neighbor show").and_yield(nil, @stdin_ipneighbor, @ipneighbor_lines, nil)
230
314
  @ohai.stub!(:popen4).with("ip addr").and_yield(nil, @stdin_ipaddr, @ipaddr_lines, nil)
231
- @ohai.stub!(:popen4).with("ip -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
315
+ @ohai.stub!(:popen4).with("ip -d -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
232
316
  @ohai._require_plugin("network")
233
317
  @ohai._require_plugin("linux::network")
234
318
  end
@@ -274,21 +358,94 @@ IP_ROUTE
274
358
  @ohai.stub!(:popen4).with("arp -an").and_yield(nil, @stdin_arp, @arp_lines, nil)
275
359
  @ohai.stub!(:popen4).with("ip neighbor show").and_yield(nil, @stdin_ipneighbor, @ipneighbor_lines, nil)
276
360
  @ohai.stub!(:popen4).with("ip addr").and_yield(nil, @stdin_ipaddr, @ipaddr_lines, nil)
277
- @ohai.stub!(:popen4).with("ip -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
278
- @ohai._require_plugin("network")
279
- @ohai._require_plugin("linux::network")
361
+ @ohai.stub!(:popen4).with("ip -d -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
280
362
  end
281
363
 
282
- it "finds the default interface by asking which iface has the default route" do
283
- @ohai['network'][:default_interface].should == 'eth0'
364
+ describe "without a subinterface" do
365
+ before do
366
+ @ohai._require_plugin("network")
367
+ @ohai._require_plugin("linux::network")
368
+ end
369
+
370
+ it "finds the default interface by asking which iface has the default route" do
371
+ @ohai['network'][:default_interface].should == 'eth0'
372
+ end
373
+
374
+ it "finds the default interface by asking which iface has the default route" do
375
+ @ohai['network'][:default_gateway].should == '10.116.201.1'
376
+ end
284
377
  end
378
+
379
+ describe "with a subinterface" do
380
+ before do
381
+ linux_ip_route_show_exact = <<-IP_ROUTE
382
+ default via 192.168.0.15 dev eth0.11
383
+ IP_ROUTE
384
+ linux_route_n = <<-ROUTE_N
385
+ Kernel IP routing table
386
+ Destination Gateway Genmask Flags Metric Ref Use Iface
387
+ 192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.11
388
+ 10.151.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.151
389
+ 10.151.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.151
390
+ 10.152.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0.152
391
+ 10.153.0.0 0.0.0.0 255.255.252.0 U 0 0 0 eth0.153
392
+ 0.0.0.0 192.168.0.15 0.0.0.0 UG 0 0 0 eth0.11
393
+ ROUTE_N
285
394
 
286
- it "finds the default interface by asking which iface has the default route" do
287
- @ohai['network'][:default_gateway].should == '10.116.201.1'
395
+ @iproute_lines = linux_ip_route_show_exact
396
+ @route_lines = linux_route_n.split("\n")
397
+ @ohai.stub!(:from).with("route -n \| grep -m 1 ^0.0.0.0").and_return(@route_lines.last)
398
+ @ohai.stub!(:from).with("ip route show exact 0.0.0.0/0").and_return(@iproute_lines)
399
+ @ohai._require_plugin("network")
400
+ @ohai._require_plugin("linux::network")
401
+ end
402
+
403
+ it "finds the default interface by asking which iface has the default route" do
404
+ @ohai['network'][:default_interface].should == 'eth0.11'
405
+ end
406
+
407
+ it "finds the default interface by asking which iface has the default route" do
408
+ @ohai['network'][:default_gateway].should == '192.168.0.15'
409
+ end
288
410
  end
289
411
  end
290
-
291
412
  end
292
413
 
414
+ describe "for newer network features using iproute2 only" do
415
+ before do
416
+ File.stub!(:exist?).with("/sbin/ip").and_return(true) # iproute2 only
417
+ @ohai.stub!(:from).with("route -n \| grep -m 1 ^0.0.0.0").and_return(@route_lines.last)
418
+ @ohai.stub!(:from).with("ip route show exact 0.0.0.0/0").and_return(@iproute_lines)
419
+ @ohai.stub!(:popen4).with("ifconfig -a").and_yield(nil, @stdin_ifconfig, @ifconfig_lines, nil)
420
+ @ohai.stub!(:popen4).with("arp -an").and_yield(nil, @stdin_arp, @arp_lines, nil)
421
+ @ohai.stub!(:popen4).with("ip neighbor show").and_yield(nil, @stdin_ipneighbor, @ipneighbor_lines, nil)
422
+ @ohai.stub!(:popen4).with("ip addr").and_yield(nil, @stdin_ipaddr, @ipaddr_lines, nil)
423
+ @ohai.stub!(:popen4).with("ip -d -s link").and_yield(nil, @stdin_iplink, @iplink_lines, nil)
424
+ @ohai._require_plugin("network")
425
+ @ohai._require_plugin("linux::network")
426
+ end
427
+
428
+ it "detects the ipv4 addresses of an ethernet interface with a crazy name" do
429
+ @ohai['network']['interfaces']['foo:veth0@eth0']['addresses'].keys.should include('192.168.212.2')
430
+ @ohai['network']['interfaces']['foo:veth0@eth0']['addresses']['192.168.212.2']['netmask'].should == '255.255.255.0'
431
+ @ohai['network']['interfaces']['foo:veth0@eth0']['addresses']['192.168.212.2']['family'].should == 'inet'
432
+ end
433
+
434
+ it "generates a fake interface for ip aliases for backward compatibility" do
435
+ @ohai['network']['interfaces']['eth0:5']['addresses'].keys.should include('192.168.5.1')
436
+ @ohai['network']['interfaces']['eth0:5']['addresses']['192.168.5.1']['netmask'].should == '255.255.255.0'
437
+ @ohai['network']['interfaces']['eth0:5']['addresses']['192.168.5.1']['family'].should == 'inet'
438
+ end
439
+
440
+ it "adds the vlan information of an interface" do
441
+ @ohai['network']['interfaces']['eth0.11']['vlan']['id'].should == '11'
442
+ @ohai['network']['interfaces']['eth0.11']['vlan']['flags'].should == [ 'REORDER_HDR' ]
443
+ end
444
+
445
+ it "adds the state of an interface" do
446
+ @ohai['network']['interfaces']['eth0.11']['state'].should == 'up'
447
+ end
448
+
449
+ end
293
450
  end
294
451
 
@@ -1,3 +1,4 @@
1
+ require 'rspec'
1
2
  require 'mixlib/config'
2
3
 
3
4
  $:.unshift(File.dirname(__FILE__) + '/../lib')
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ohai
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15424019
4
+ hash: 15424029
5
5
  prerelease: 7
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
9
  - 12
10
10
  - rc
11
- - 3
12
- version: 0.6.12.rc.3
11
+ - 4
12
+ version: 0.6.12.rc.4
13
13
  platform: ruby
14
14
  authors:
15
15
  - Adam Jacob
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-03-06 00:00:00 Z
20
+ date: 2012-03-13 00:00:00 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: systemu
@@ -172,206 +172,206 @@ files:
172
172
  - README.rdoc
173
173
  - Rakefile
174
174
  - docs/man/man1/ohai.1
175
- - lib/ohai/exception.rb
175
+ - lib/ohai.rb
176
+ - lib/ohai/plugins/languages.rb
177
+ - lib/ohai/plugins/virtualization.rb
178
+ - lib/ohai/plugins/dmi.rb
179
+ - lib/ohai/plugins/passwd.rb
180
+ - lib/ohai/plugins/ohai.rb
181
+ - lib/ohai/plugins/php.rb
182
+ - lib/ohai/plugins/ip_scopes.rb
183
+ - lib/ohai/plugins/keys.rb
184
+ - lib/ohai/plugins/dmi_common.rb
185
+ - lib/ohai/plugins/rackspace.rb
176
186
  - lib/ohai/plugins/erlang.rb
177
- - lib/ohai/plugins/windows/network.rb
178
- - lib/ohai/plugins/windows/filesystem.rb
179
- - lib/ohai/plugins/windows/platform.rb
180
- - lib/ohai/plugins/windows/kernel.rb
181
- - lib/ohai/plugins/windows/hostname.rb
182
- - lib/ohai/plugins/windows/cpu.rb
183
- - lib/ohai/plugins/netbsd/network.rb
184
- - lib/ohai/plugins/netbsd/filesystem.rb
185
- - lib/ohai/plugins/netbsd/platform.rb
186
- - lib/ohai/plugins/netbsd/ssh_host_key.rb
187
- - lib/ohai/plugins/netbsd/uptime.rb
188
- - lib/ohai/plugins/netbsd/kernel.rb
189
- - lib/ohai/plugins/netbsd/memory.rb
190
- - lib/ohai/plugins/netbsd/hostname.rb
191
- - lib/ohai/plugins/netbsd/cpu.rb
192
- - lib/ohai/plugins/netbsd/virtualization.rb
193
- - lib/ohai/plugins/netbsd/ps.rb
194
- - lib/ohai/plugins/network.rb
195
- - lib/ohai/plugins/perl.rb
196
- - lib/ohai/plugins/openbsd/network.rb
197
- - lib/ohai/plugins/openbsd/filesystem.rb
198
- - lib/ohai/plugins/openbsd/platform.rb
199
- - lib/ohai/plugins/openbsd/ssh_host_key.rb
200
- - lib/ohai/plugins/openbsd/uptime.rb
201
- - lib/ohai/plugins/openbsd/kernel.rb
202
- - lib/ohai/plugins/openbsd/memory.rb
203
- - lib/ohai/plugins/openbsd/hostname.rb
204
- - lib/ohai/plugins/openbsd/cpu.rb
205
- - lib/ohai/plugins/openbsd/virtualization.rb
206
- - lib/ohai/plugins/openbsd/ps.rb
207
- - lib/ohai/plugins/linux/network.rb
208
- - lib/ohai/plugins/linux/filesystem.rb
209
- - lib/ohai/plugins/linux/platform.rb
210
- - lib/ohai/plugins/linux/ssh_host_key.rb
211
- - lib/ohai/plugins/linux/uptime.rb
212
- - lib/ohai/plugins/linux/kernel.rb
213
- - lib/ohai/plugins/linux/memory.rb
187
+ - lib/ohai/plugins/freebsd/virtualization.rb
188
+ - lib/ohai/plugins/freebsd/memory.rb
189
+ - lib/ohai/plugins/freebsd/hostname.rb
190
+ - lib/ohai/plugins/freebsd/uptime.rb
191
+ - lib/ohai/plugins/freebsd/ssh_host_key.rb
192
+ - lib/ohai/plugins/freebsd/network.rb
193
+ - lib/ohai/plugins/freebsd/kernel.rb
194
+ - lib/ohai/plugins/freebsd/platform.rb
195
+ - lib/ohai/plugins/freebsd/ps.rb
196
+ - lib/ohai/plugins/freebsd/cpu.rb
197
+ - lib/ohai/plugins/freebsd/filesystem.rb
198
+ - lib/ohai/plugins/linux/virtualization.rb
214
199
  - lib/ohai/plugins/linux/lsb.rb
215
- - lib/ohai/plugins/linux/block_device.rb
200
+ - lib/ohai/plugins/linux/memory.rb
216
201
  - lib/ohai/plugins/linux/hostname.rb
217
- - lib/ohai/plugins/linux/cpu.rb
218
- - lib/ohai/plugins/linux/virtualization.rb
202
+ - lib/ohai/plugins/linux/uptime.rb
203
+ - lib/ohai/plugins/linux/ssh_host_key.rb
204
+ - lib/ohai/plugins/linux/block_device.rb
205
+ - lib/ohai/plugins/linux/network.rb
206
+ - lib/ohai/plugins/linux/kernel.rb
207
+ - lib/ohai/plugins/linux/platform.rb
219
208
  - lib/ohai/plugins/linux/ps.rb
220
- - lib/ohai/plugins/platform.rb
209
+ - lib/ohai/plugins/linux/cpu.rb
210
+ - lib/ohai/plugins/linux/filesystem.rb
211
+ - lib/ohai/plugins/groovy.rb
212
+ - lib/ohai/plugins/darwin/hostname.rb
213
+ - lib/ohai/plugins/darwin/uptime.rb
214
+ - lib/ohai/plugins/darwin/ssh_host_key.rb
215
+ - lib/ohai/plugins/darwin/network.rb
216
+ - lib/ohai/plugins/darwin/system_profiler.rb
217
+ - lib/ohai/plugins/darwin/kernel.rb
218
+ - lib/ohai/plugins/darwin/platform.rb
219
+ - lib/ohai/plugins/darwin/ps.rb
220
+ - lib/ohai/plugins/darwin/filesystem.rb
221
+ - lib/ohai/plugins/chef.rb
222
+ - lib/ohai/plugins/hostname.rb
223
+ - lib/ohai/plugins/perl.rb
224
+ - lib/ohai/plugins/uptime.rb
225
+ - lib/ohai/plugins/ec2.rb
221
226
  - lib/ohai/plugins/network_listeners.rb
222
- - lib/ohai/plugins/dmi_common.rb
223
- - lib/ohai/plugins/solaris2/network.rb
224
- - lib/ohai/plugins/solaris2/filesystem.rb
225
- - lib/ohai/plugins/solaris2/platform.rb
227
+ - lib/ohai/plugins/hpux/memory.rb
228
+ - lib/ohai/plugins/hpux/hostname.rb
229
+ - lib/ohai/plugins/hpux/uptime.rb
230
+ - lib/ohai/plugins/hpux/ssh_host_key.rb
231
+ - lib/ohai/plugins/hpux/network.rb
232
+ - lib/ohai/plugins/hpux/platform.rb
233
+ - lib/ohai/plugins/hpux/ps.rb
234
+ - lib/ohai/plugins/hpux/cpu.rb
235
+ - lib/ohai/plugins/hpux/filesystem.rb
236
+ - lib/ohai/plugins/mono.rb
237
+ - lib/ohai/plugins/solaris2/virtualization.rb
226
238
  - lib/ohai/plugins/solaris2/dmi.rb
227
- - lib/ohai/plugins/solaris2/ssh_host_key.rb
228
- - lib/ohai/plugins/solaris2/uptime.rb
229
- - lib/ohai/plugins/solaris2/kernel.rb
230
239
  - lib/ohai/plugins/solaris2/hostname.rb
231
- - lib/ohai/plugins/solaris2/cpu.rb
240
+ - lib/ohai/plugins/solaris2/uptime.rb
241
+ - lib/ohai/plugins/solaris2/ssh_host_key.rb
242
+ - lib/ohai/plugins/solaris2/network.rb
232
243
  - lib/ohai/plugins/solaris2/zpools.rb
233
- - lib/ohai/plugins/solaris2/virtualization.rb
244
+ - lib/ohai/plugins/solaris2/kernel.rb
245
+ - lib/ohai/plugins/solaris2/platform.rb
234
246
  - lib/ohai/plugins/solaris2/ps.rb
235
- - lib/ohai/plugins/php.rb
236
- - lib/ohai/plugins/dmi.rb
247
+ - lib/ohai/plugins/solaris2/cpu.rb
248
+ - lib/ohai/plugins/solaris2/filesystem.rb
249
+ - lib/ohai/plugins/ohai_time.rb
250
+ - lib/ohai/plugins/c.rb
251
+ - lib/ohai/plugins/lua.rb
252
+ - lib/ohai/plugins/openbsd/virtualization.rb
253
+ - lib/ohai/plugins/openbsd/memory.rb
254
+ - lib/ohai/plugins/openbsd/hostname.rb
255
+ - lib/ohai/plugins/openbsd/uptime.rb
256
+ - lib/ohai/plugins/openbsd/ssh_host_key.rb
257
+ - lib/ohai/plugins/openbsd/network.rb
258
+ - lib/ohai/plugins/openbsd/kernel.rb
259
+ - lib/ohai/plugins/openbsd/platform.rb
260
+ - lib/ohai/plugins/openbsd/ps.rb
261
+ - lib/ohai/plugins/openbsd/cpu.rb
262
+ - lib/ohai/plugins/openbsd/filesystem.rb
263
+ - lib/ohai/plugins/python.rb
264
+ - lib/ohai/plugins/network.rb
265
+ - lib/ohai/plugins/kernel.rb
266
+ - lib/ohai/plugins/cloud.rb
237
267
  - lib/ohai/plugins/java.rb
238
- - lib/ohai/plugins/chef.rb
239
- - lib/ohai/plugins/mono.rb
268
+ - lib/ohai/plugins/platform.rb
269
+ - lib/ohai/plugins/ruby.rb
270
+ - lib/ohai/plugins/os.rb
271
+ - lib/ohai/plugins/sigar/memory.rb
272
+ - lib/ohai/plugins/sigar/hostname.rb
273
+ - lib/ohai/plugins/sigar/uptime.rb
240
274
  - lib/ohai/plugins/sigar/network.rb
241
- - lib/ohai/plugins/sigar/filesystem.rb
242
275
  - lib/ohai/plugins/sigar/network_route.rb
243
276
  - lib/ohai/plugins/sigar/platform.rb
244
- - lib/ohai/plugins/sigar/uptime.rb
245
- - lib/ohai/plugins/sigar/memory.rb
246
- - lib/ohai/plugins/sigar/hostname.rb
247
277
  - lib/ohai/plugins/sigar/cpu.rb
248
- - lib/ohai/plugins/uptime.rb
249
- - lib/ohai/plugins/kernel.rb
250
- - lib/ohai/plugins/passwd.rb
278
+ - lib/ohai/plugins/sigar/filesystem.rb
279
+ - lib/ohai/plugins/command.rb
280
+ - lib/ohai/plugins/windows/hostname.rb
281
+ - lib/ohai/plugins/windows/network.rb
282
+ - lib/ohai/plugins/windows/kernel.rb
283
+ - lib/ohai/plugins/windows/platform.rb
284
+ - lib/ohai/plugins/windows/cpu.rb
285
+ - lib/ohai/plugins/windows/filesystem.rb
251
286
  - lib/ohai/plugins/eucalyptus.rb
252
- - lib/ohai/plugins/cloud.rb
253
- - lib/ohai/plugins/python.rb
254
- - lib/ohai/plugins/aix/network.rb
255
- - lib/ohai/plugins/aix/filesystem.rb
256
- - lib/ohai/plugins/aix/platform.rb
257
- - lib/ohai/plugins/aix/ssh_host_key.rb
258
- - lib/ohai/plugins/aix/uptime.rb
287
+ - lib/ohai/plugins/netbsd/virtualization.rb
288
+ - lib/ohai/plugins/netbsd/memory.rb
289
+ - lib/ohai/plugins/netbsd/hostname.rb
290
+ - lib/ohai/plugins/netbsd/uptime.rb
291
+ - lib/ohai/plugins/netbsd/ssh_host_key.rb
292
+ - lib/ohai/plugins/netbsd/network.rb
293
+ - lib/ohai/plugins/netbsd/kernel.rb
294
+ - lib/ohai/plugins/netbsd/platform.rb
295
+ - lib/ohai/plugins/netbsd/ps.rb
296
+ - lib/ohai/plugins/netbsd/cpu.rb
297
+ - lib/ohai/plugins/netbsd/filesystem.rb
259
298
  - lib/ohai/plugins/aix/memory.rb
260
299
  - lib/ohai/plugins/aix/hostname.rb
261
- - lib/ohai/plugins/aix/cpu.rb
300
+ - lib/ohai/plugins/aix/uptime.rb
301
+ - lib/ohai/plugins/aix/ssh_host_key.rb
302
+ - lib/ohai/plugins/aix/network.rb
303
+ - lib/ohai/plugins/aix/platform.rb
262
304
  - lib/ohai/plugins/aix/ps.rb
263
- - lib/ohai/plugins/rackspace.rb
264
- - lib/ohai/plugins/darwin/network.rb
265
- - lib/ohai/plugins/darwin/filesystem.rb
266
- - lib/ohai/plugins/darwin/system_profiler.rb
267
- - lib/ohai/plugins/darwin/platform.rb
268
- - lib/ohai/plugins/darwin/ssh_host_key.rb
269
- - lib/ohai/plugins/darwin/uptime.rb
270
- - lib/ohai/plugins/darwin/kernel.rb
271
- - lib/ohai/plugins/darwin/hostname.rb
272
- - lib/ohai/plugins/darwin/ps.rb
273
- - lib/ohai/plugins/groovy.rb
274
- - lib/ohai/plugins/hostname.rb
275
- - lib/ohai/plugins/hpux/network.rb
276
- - lib/ohai/plugins/hpux/filesystem.rb
277
- - lib/ohai/plugins/hpux/platform.rb
278
- - lib/ohai/plugins/hpux/ssh_host_key.rb
279
- - lib/ohai/plugins/hpux/uptime.rb
280
- - lib/ohai/plugins/hpux/memory.rb
281
- - lib/ohai/plugins/hpux/hostname.rb
282
- - lib/ohai/plugins/hpux/cpu.rb
283
- - lib/ohai/plugins/hpux/ps.rb
284
- - lib/ohai/plugins/languages.rb
285
- - lib/ohai/plugins/ohai.rb
286
- - lib/ohai/plugins/os.rb
287
- - lib/ohai/plugins/ip_scopes.rb
288
- - lib/ohai/plugins/ohai_time.rb
289
- - lib/ohai/plugins/command.rb
290
- - lib/ohai/plugins/c.rb
291
- - lib/ohai/plugins/ruby.rb
292
- - lib/ohai/plugins/ec2.rb
293
- - lib/ohai/plugins/freebsd/network.rb
294
- - lib/ohai/plugins/freebsd/filesystem.rb
295
- - lib/ohai/plugins/freebsd/platform.rb
296
- - lib/ohai/plugins/freebsd/ssh_host_key.rb
297
- - lib/ohai/plugins/freebsd/uptime.rb
298
- - lib/ohai/plugins/freebsd/kernel.rb
299
- - lib/ohai/plugins/freebsd/memory.rb
300
- - lib/ohai/plugins/freebsd/hostname.rb
301
- - lib/ohai/plugins/freebsd/cpu.rb
302
- - lib/ohai/plugins/freebsd/virtualization.rb
303
- - lib/ohai/plugins/freebsd/ps.rb
304
- - lib/ohai/plugins/lua.rb
305
- - lib/ohai/plugins/keys.rb
306
- - lib/ohai/plugins/virtualization.rb
305
+ - lib/ohai/plugins/aix/cpu.rb
306
+ - lib/ohai/plugins/aix/filesystem.rb
307
+ - lib/ohai/application.rb
307
308
  - lib/ohai/version.rb
308
309
  - lib/ohai/mash.rb
309
- - lib/ohai/system.rb
310
- - lib/ohai/log.rb
310
+ - lib/ohai/exception.rb
311
311
  - lib/ohai/config.rb
312
- - lib/ohai/application.rb
313
- - lib/ohai/mixin/ec2_metadata.rb
314
- - lib/ohai/mixin/from_file.rb
312
+ - lib/ohai/log.rb
313
+ - lib/ohai/system.rb
315
314
  - lib/ohai/mixin/string.rb
315
+ - lib/ohai/mixin/from_file.rb
316
316
  - lib/ohai/mixin/command.rb
317
- - lib/ohai.rb
318
- - spec/rcov.opts
319
- - spec/ohai/plugins/erlang_spec.rb
320
- - spec/ohai/plugins/netbsd/kernel_spec.rb
321
- - spec/ohai/plugins/netbsd/hostname_spec.rb
322
- - spec/ohai/plugins/netbsd/platform_spec.rb
317
+ - lib/ohai/mixin/ec2_metadata.rb
318
+ - spec/ohai/plugins/groovy_spec.rb
323
319
  - spec/ohai/plugins/lua_spec.rb
324
- - spec/ohai/plugins/openbsd/kernel_spec.rb
325
- - spec/ohai/plugins/openbsd/hostname_spec.rb
326
- - spec/ohai/plugins/openbsd/platform_spec.rb
327
- - spec/ohai/plugins/passwd_spec.rb
328
- - spec/ohai/plugins/ohai_time_spec.rb
329
- - spec/ohai/plugins/kernel_spec.rb
330
- - spec/ohai/plugins/linux/lsb_spec.rb
331
- - spec/ohai/plugins/linux/virtualization_spec.rb
320
+ - spec/ohai/plugins/ec2_spec.rb
321
+ - spec/ohai/plugins/ruby_spec.rb
322
+ - spec/ohai/plugins/fail_spec.rb
323
+ - spec/ohai/plugins/rackspace_spec.rb
324
+ - spec/ohai/plugins/freebsd/kernel_spec.rb
325
+ - spec/ohai/plugins/freebsd/platform_spec.rb
326
+ - spec/ohai/plugins/freebsd/hostname_spec.rb
327
+ - spec/ohai/plugins/php_spec.rb
328
+ - spec/ohai/plugins/linux/cpu_spec.rb
329
+ - spec/ohai/plugins/linux/network_spec.rb
332
330
  - spec/ohai/plugins/linux/kernel_spec.rb
331
+ - spec/ohai/plugins/linux/platform_spec.rb
333
332
  - spec/ohai/plugins/linux/uptime_spec.rb
334
- - spec/ohai/plugins/linux/network_spec.rb
335
- - spec/ohai/plugins/linux/filesystem_spec.rb
336
- - spec/ohai/plugins/linux/cpu_spec.rb
333
+ - spec/ohai/plugins/linux/virtualization_spec.rb
334
+ - spec/ohai/plugins/linux/lsb_spec.rb
337
335
  - spec/ohai/plugins/linux/hostname_spec.rb
338
- - spec/ohai/plugins/linux/platform_spec.rb
339
- - spec/ohai/plugins/c_spec.rb
340
- - spec/ohai/plugins/solaris2/virtualization_spec.rb
341
- - spec/ohai/plugins/solaris2/kernel_spec.rb
342
- - spec/ohai/plugins/solaris2/network_spec.rb
343
- - spec/ohai/plugins/solaris2/hostname_spec.rb
344
- - spec/ohai/plugins/cloud_spec.rb
345
- - spec/ohai/plugins/ruby_spec.rb
346
- - spec/ohai/plugins/python_spec.rb
347
- - spec/ohai/plugins/sigar/network_route_spec.rb
348
- - spec/ohai/plugins/ohai_spec.rb
349
- - spec/ohai/plugins/hostname_spec.rb
350
- - spec/ohai/plugins/eucalyptus_spec.rb
351
- - spec/ohai/plugins/mono_spec.rb
352
- - spec/ohai/plugins/rackspace_spec.rb
353
- - spec/ohai/plugins/java_spec.rb
336
+ - spec/ohai/plugins/linux/filesystem_spec.rb
337
+ - spec/ohai/plugins/chef_spec.rb
354
338
  - spec/ohai/plugins/darwin/kernel_spec.rb
355
- - spec/ohai/plugins/darwin/hostname_spec.rb
356
339
  - spec/ohai/plugins/darwin/platform_spec.rb
357
- - spec/ohai/plugins/ec2_spec.rb
358
- - spec/ohai/plugins/fail_spec.rb
340
+ - spec/ohai/plugins/darwin/hostname_spec.rb
341
+ - spec/ohai/plugins/python_spec.rb
342
+ - spec/ohai/plugins/java_spec.rb
343
+ - spec/ohai/plugins/kernel_spec.rb
359
344
  - spec/ohai/plugins/dmi_spec.rb
360
- - spec/ohai/plugins/chef_spec.rb
361
- - spec/ohai/plugins/php_spec.rb
362
- - spec/ohai/plugins/groovy_spec.rb
363
- - spec/ohai/plugins/perl_spec.rb
345
+ - spec/ohai/plugins/mono_spec.rb
346
+ - spec/ohai/plugins/solaris2/network_spec.rb
347
+ - spec/ohai/plugins/solaris2/kernel_spec.rb
348
+ - spec/ohai/plugins/solaris2/virtualization_spec.rb
349
+ - spec/ohai/plugins/solaris2/hostname_spec.rb
350
+ - spec/ohai/plugins/openbsd/kernel_spec.rb
351
+ - spec/ohai/plugins/openbsd/platform_spec.rb
352
+ - spec/ohai/plugins/openbsd/hostname_spec.rb
364
353
  - spec/ohai/plugins/platform_spec.rb
365
- - spec/ohai/plugins/freebsd/kernel_spec.rb
366
- - spec/ohai/plugins/freebsd/hostname_spec.rb
367
- - spec/ohai/plugins/freebsd/platform_spec.rb
354
+ - spec/ohai/plugins/erlang_spec.rb
355
+ - spec/ohai/plugins/perl_spec.rb
356
+ - spec/ohai/plugins/c_spec.rb
357
+ - spec/ohai/plugins/ohai_spec.rb
358
+ - spec/ohai/plugins/sigar/network_route_spec.rb
368
359
  - spec/ohai/plugins/os_spec.rb
360
+ - spec/ohai/plugins/passwd_spec.rb
361
+ - spec/ohai/plugins/cloud_spec.rb
362
+ - spec/ohai/plugins/eucalyptus_spec.rb
363
+ - spec/ohai/plugins/netbsd/kernel_spec.rb
364
+ - spec/ohai/plugins/netbsd/platform_spec.rb
365
+ - spec/ohai/plugins/netbsd/hostname_spec.rb
366
+ - spec/ohai/plugins/hostname_spec.rb
367
+ - spec/ohai/plugins/ohai_time_spec.rb
368
+ - spec/ohai/system_spec.rb
369
369
  - spec/ohai/mixin/command_spec.rb
370
370
  - spec/ohai/mixin/from_file_spec.rb
371
- - spec/ohai/system_spec.rb
372
371
  - spec/spec_helper.rb
373
- - spec/ohai_spec.rb
374
372
  - spec/spec.opts
373
+ - spec/rcov.opts
374
+ - spec/ohai_spec.rb
375
375
  - bin/ohai
376
376
  homepage: http://wiki.opscode.com/display/chef/Ohai
377
377
  licenses: []