ohai 8.10.0 → 8.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -2
- data/Rakefile +13 -4
- data/bin/ohai +3 -4
- data/lib/ohai.rb +4 -4
- data/lib/ohai/application.rb +7 -6
- data/lib/ohai/common/dmi.rb +56 -56
- data/lib/ohai/config.rb +12 -8
- data/lib/ohai/dsl.rb +3 -3
- data/lib/ohai/dsl/plugin.rb +5 -5
- data/lib/ohai/dsl/plugin/versionvi.rb +0 -1
- data/lib/ohai/dsl/plugin/versionvii.rb +1 -0
- data/lib/ohai/hints.rb +1 -1
- data/lib/ohai/loader.rb +7 -7
- data/lib/ohai/log.rb +1 -1
- data/lib/ohai/mash.rb +3 -2
- data/lib/ohai/mixin/command.rb +25 -23
- data/lib/ohai/mixin/dmi_decode.rb +10 -10
- data/lib/ohai/mixin/ec2_metadata.rb +40 -39
- data/lib/ohai/mixin/gce_metadata.rb +9 -9
- data/lib/ohai/mixin/network_constants.rb +1 -1
- data/lib/ohai/mixin/os.rb +3 -3
- data/lib/ohai/mixin/seconds_to_human.rb +0 -2
- data/lib/ohai/mixin/softlayer_metadata.rb +10 -10
- data/lib/ohai/mixin/string.rb +2 -2
- data/lib/ohai/plugin_config.rb +1 -1
- data/lib/ohai/plugins/aix/cpu.rb +2 -2
- data/lib/ohai/plugins/aix/filesystem.rb +2 -2
- data/lib/ohai/plugins/aix/memory.rb +2 -2
- data/lib/ohai/plugins/aix/network.rb +9 -10
- data/lib/ohai/plugins/aix/os.rb +2 -2
- data/lib/ohai/plugins/aix/uptime.rb +3 -3
- data/lib/ohai/plugins/aix/virtualization.rb +23 -23
- data/lib/ohai/plugins/azure.rb +32 -5
- data/lib/ohai/plugins/bsd/virtualization.rb +22 -22
- data/lib/ohai/plugins/c.rb +3 -3
- data/lib/ohai/plugins/chef.rb +1 -1
- data/lib/ohai/plugins/cloud.rb +59 -60
- data/lib/ohai/plugins/cloud_v2.rb +37 -39
- data/lib/ohai/plugins/darwin/cpu.rb +1 -1
- data/lib/ohai/plugins/darwin/filesystem2.rb +5 -5
- data/lib/ohai/plugins/darwin/memory.rb +5 -6
- data/lib/ohai/plugins/darwin/network.rb +7 -7
- data/lib/ohai/plugins/darwin/system_profiler.rb +32 -33
- data/lib/ohai/plugins/darwin/virtualization.rb +9 -9
- data/lib/ohai/plugins/digital_ocean.rb +16 -16
- data/lib/ohai/plugins/dmi.rb +6 -6
- data/lib/ohai/plugins/dragonflybsd/cpu.rb +2 -2
- data/lib/ohai/plugins/dragonflybsd/memory.rb +0 -1
- data/lib/ohai/plugins/dragonflybsd/network.rb +4 -4
- data/lib/ohai/plugins/dragonflybsd/os.rb +1 -1
- data/lib/ohai/plugins/ec2.rb +39 -15
- data/lib/ohai/plugins/elixir.rb +1 -1
- data/lib/ohai/plugins/erlang.rb +3 -3
- data/lib/ohai/plugins/eucalyptus.rb +16 -12
- data/lib/ohai/plugins/freebsd/cpu.rb +2 -2
- data/lib/ohai/plugins/freebsd/memory.rb +0 -1
- data/lib/ohai/plugins/freebsd/network.rb +4 -4
- data/lib/ohai/plugins/freebsd/os.rb +1 -1
- data/lib/ohai/plugins/gce.rb +6 -6
- data/lib/ohai/plugins/hostname.rb +7 -7
- data/lib/ohai/plugins/init_package.rb +1 -1
- data/lib/ohai/plugins/ip_scopes.rb +9 -9
- data/lib/ohai/plugins/java.rb +1 -1
- data/lib/ohai/plugins/joyent.rb +7 -7
- data/lib/ohai/plugins/kernel.rb +8 -8
- data/lib/ohai/plugins/linode.rb +7 -4
- data/lib/ohai/plugins/linux/cpu.rb +5 -5
- data/lib/ohai/plugins/linux/filesystem.rb +16 -16
- data/lib/ohai/plugins/linux/filesystem2.rb +15 -15
- data/lib/ohai/plugins/linux/mdadm.rb +3 -3
- data/lib/ohai/plugins/linux/network.rb +85 -51
- data/lib/ohai/plugins/linux/platform.rb +24 -24
- data/lib/ohai/plugins/linux/virtualization.rb +8 -8
- data/lib/ohai/plugins/mono.rb +1 -1
- data/lib/ohai/plugins/netbsd/cpu.rb +1 -1
- data/lib/ohai/plugins/netbsd/network.rb +2 -2
- data/lib/ohai/plugins/network.rb +11 -11
- data/lib/ohai/plugins/network_listeners.rb +30 -26
- data/lib/ohai/plugins/ohai.rb +3 -3
- data/lib/ohai/plugins/openbsd/cpu.rb +4 -4
- data/lib/ohai/plugins/openbsd/memory.rb +4 -4
- data/lib/ohai/plugins/openbsd/network.rb +3 -3
- data/lib/ohai/plugins/openstack.rb +12 -12
- data/lib/ohai/plugins/os.rb +2 -2
- data/lib/ohai/plugins/packages.rb +22 -22
- data/lib/ohai/plugins/passwd.rb +4 -4
- data/lib/ohai/plugins/powershell.rb +9 -9
- data/lib/ohai/plugins/ps.rb +2 -2
- data/lib/ohai/plugins/python.rb +1 -1
- data/lib/ohai/plugins/rackspace.rb +13 -13
- data/lib/ohai/plugins/root_group.rb +4 -4
- data/lib/ohai/plugins/ruby.rb +6 -6
- data/lib/ohai/plugins/rust.rb +1 -1
- data/lib/ohai/plugins/sigar/cpu.rb +1 -1
- data/lib/ohai/plugins/sigar/filesystem.rb +1 -1
- data/lib/ohai/plugins/sigar/network.rb +13 -13
- data/lib/ohai/plugins/sigar/network_route.rb +34 -29
- data/lib/ohai/plugins/softlayer.rb +8 -7
- data/lib/ohai/plugins/solaris2/cpu.rb +19 -19
- data/lib/ohai/plugins/solaris2/dmi.rb +63 -63
- data/lib/ohai/plugins/solaris2/filesystem.rb +13 -13
- data/lib/ohai/plugins/solaris2/memory.rb +2 -2
- data/lib/ohai/plugins/solaris2/network.rb +5 -5
- data/lib/ohai/plugins/solaris2/virtualization.rb +18 -18
- data/lib/ohai/plugins/solaris2/zpools.rb +1 -1
- data/lib/ohai/plugins/ssh_host_key.rb +2 -2
- data/lib/ohai/plugins/uptime.rb +4 -5
- data/lib/ohai/plugins/virtualbox.rb +2 -2
- data/lib/ohai/plugins/virtualization.rb +17 -17
- data/lib/ohai/plugins/vmware.rb +2 -2
- data/lib/ohai/plugins/windows/cpu.rb +14 -14
- data/lib/ohai/plugins/windows/drivers.rb +8 -8
- data/lib/ohai/plugins/windows/filesystem.rb +4 -4
- data/lib/ohai/plugins/windows/memory.rb +1 -1
- data/lib/ohai/plugins/windows/network.rb +10 -10
- data/lib/ohai/plugins/windows/platform.rb +1 -2
- data/lib/ohai/plugins/windows/virtualization.rb +17 -17
- data/lib/ohai/provides_map.rb +7 -7
- data/lib/ohai/runner.rb +3 -3
- data/lib/ohai/system.rb +21 -20
- data/lib/ohai/util/file_helper.rb +1 -2
- data/lib/ohai/util/ip_helper.rb +4 -4
- data/lib/ohai/util/win32.rb +5 -5
- data/lib/ohai/util/win32/group_helper.rb +4 -5
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +7 -5
- data/spec/functional/application_spec.rb +23 -23
- data/spec/functional/loader_spec.rb +1 -1
- data/spec/functional/plugins/powershell_spec.rb +13 -13
- data/spec/functional/plugins/root_group_spec.rb +5 -5
- data/spec/ohai_spec.rb +1 -1
- data/spec/spec_helper.rb +9 -9
- data/spec/support/integration_helper.rb +7 -7
- data/spec/support/platform_helpers.rb +1 -1
- data/spec/unit/application_spec.rb +17 -17
- data/spec/unit/config_spec.rb +2 -2
- data/spec/unit/dsl/plugin_spec.rb +28 -28
- data/spec/unit/hints_spec.rb +3 -3
- data/spec/unit/loader_spec.rb +9 -9
- data/spec/unit/mixin/command_spec.rb +5 -5
- data/spec/unit/mixin/ec2_metadata_spec.rb +6 -6
- data/spec/unit/mixin/softlayer_metadata_spec.rb +19 -23
- data/spec/unit/plugin_config_spec.rb +5 -5
- data/spec/unit/plugins/abort_spec.rb +3 -3
- data/spec/unit/plugins/aix/cpu_spec.rb +1 -1
- data/spec/unit/plugins/aix/filesystem_spec.rb +25 -25
- data/spec/unit/plugins/aix/hostname_spec.rb +1 -2
- data/spec/unit/plugins/aix/kernel_spec.rb +3 -3
- data/spec/unit/plugins/aix/memory_spec.rb +8 -8
- data/spec/unit/plugins/aix/network_spec.rb +38 -38
- data/spec/unit/plugins/aix/os_spec.rb +1 -2
- data/spec/unit/plugins/aix/platform_spec.rb +1 -1
- data/spec/unit/plugins/aix/uptime_spec.rb +1 -1
- data/spec/unit/plugins/aix/virtualization_spec.rb +11 -11
- data/spec/unit/plugins/azure_spec.rb +118 -20
- data/spec/unit/plugins/bsd/filesystem_spec.rb +1 -1
- data/spec/unit/plugins/bsd/virtualization_spec.rb +4 -4
- data/spec/unit/plugins/c_spec.rb +12 -12
- data/spec/unit/plugins/chef_spec.rb +2 -2
- data/spec/unit/plugins/cloud_spec.rb +37 -37
- data/spec/unit/plugins/cloud_v2_spec.rb +64 -65
- data/spec/unit/plugins/darwin/cpu_spec.rb +1 -2
- data/spec/unit/plugins/darwin/filesystem2_spec.rb +7 -7
- data/spec/unit/plugins/darwin/filesystem_spec.rb +5 -5
- data/spec/unit/plugins/darwin/hostname_spec.rb +1 -4
- data/spec/unit/plugins/darwin/kernel_spec.rb +6 -10
- data/spec/unit/plugins/darwin/memory_spec.rb +5 -5
- data/spec/unit/plugins/darwin/network_spec.rb +352 -353
- data/spec/unit/plugins/darwin/platform_spec.rb +1 -2
- data/spec/unit/plugins/darwin/system_profiler_spec.rb +3 -3
- data/spec/unit/plugins/darwin/virtualization_spec.rb +6 -6
- data/spec/unit/plugins/digital_ocean_spec.rb +38 -37
- data/spec/unit/plugins/dmi_spec.rb +3 -3
- data/spec/unit/plugins/ec2_spec.rb +97 -88
- data/spec/unit/plugins/elixir_spec.rb +1 -2
- data/spec/unit/plugins/erlang_spec.rb +2 -2
- data/spec/unit/plugins/eucalyptus_spec.rb +19 -19
- data/spec/unit/plugins/fail_spec.rb +2 -2
- data/spec/unit/plugins/freebsd/cpu_spec.rb +14 -14
- data/spec/unit/plugins/freebsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/freebsd/kernel_spec.rb +2 -3
- data/spec/unit/plugins/freebsd/os_spec.rb +4 -5
- data/spec/unit/plugins/freebsd/platform_spec.rb +1 -2
- data/spec/unit/plugins/gce_spec.rb +9 -9
- data/spec/unit/plugins/go_spec.rb +1 -1
- data/spec/unit/plugins/groovy_spec.rb +1 -2
- data/spec/unit/plugins/hostname_spec.rb +1 -2
- data/spec/unit/plugins/init_package_spec.rb +1 -1
- data/spec/unit/plugins/ip_scopes_spec.rb +38 -38
- data/spec/unit/plugins/java_spec.rb +52 -1
- data/spec/unit/plugins/joyent_spec.rb +9 -11
- data/spec/unit/plugins/kernel_spec.rb +11 -12
- data/spec/unit/plugins/linode_spec.rb +29 -29
- data/spec/unit/plugins/linux/block_device_spec.rb +21 -21
- data/spec/unit/plugins/linux/cpu_spec.rb +3 -3
- data/spec/unit/plugins/linux/filesystem2_spec.rb +7 -7
- data/spec/unit/plugins/linux/filesystem_spec.rb +85 -86
- data/spec/unit/plugins/linux/hostname_spec.rb +1 -3
- data/spec/unit/plugins/linux/kernel_spec.rb +1 -1
- data/spec/unit/plugins/linux/lsb_spec.rb +1 -2
- data/spec/unit/plugins/linux/mdadm_spec.rb +4 -4
- data/spec/unit/plugins/linux/memory_spec.rb +29 -33
- data/spec/unit/plugins/linux/network_spec.rb +463 -245
- data/spec/unit/plugins/linux/platform_spec.rb +64 -65
- data/spec/unit/plugins/linux/uptime_spec.rb +1 -2
- data/spec/unit/plugins/linux/virtualization_spec.rb +42 -42
- data/spec/unit/plugins/lua_spec.rb +1 -2
- data/spec/unit/plugins/mono_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/kernel_spec.rb +1 -2
- data/spec/unit/plugins/netbsd/platform_spec.rb +1 -1
- data/spec/unit/plugins/network_spec.rb +118 -118
- data/spec/unit/plugins/nodejs_spec.rb +1 -1
- data/spec/unit/plugins/ohai_spec.rb +1 -1
- data/spec/unit/plugins/ohai_time_spec.rb +1 -2
- data/spec/unit/plugins/openbsd/hostname_spec.rb +1 -2
- data/spec/unit/plugins/openbsd/kernel_spec.rb +1 -2
- data/spec/unit/plugins/openbsd/platform_spec.rb +1 -2
- data/spec/unit/plugins/openstack_spec.rb +35 -37
- data/spec/unit/plugins/os_spec.rb +7 -8
- data/spec/unit/plugins/packages_spec.rb +118 -118
- data/spec/unit/plugins/passwd_spec.rb +18 -18
- data/spec/unit/plugins/perl_spec.rb +1 -1
- data/spec/unit/plugins/php_spec.rb +4 -4
- data/spec/unit/plugins/platform_spec.rb +8 -9
- data/spec/unit/plugins/powershell_spec.rb +3 -3
- data/spec/unit/plugins/python_spec.rb +1 -1
- data/spec/unit/plugins/rackspace_spec.rb +66 -68
- data/spec/unit/plugins/root_group_spec.rb +26 -26
- data/spec/unit/plugins/ruby_spec.rb +14 -15
- data/spec/unit/plugins/rust_spec.rb +2 -2
- data/spec/unit/plugins/sigar/network_route_spec.rb +36 -36
- data/spec/unit/plugins/softlayer_spec.rb +10 -10
- data/spec/unit/plugins/solaris2/cpu_spec.rb +20 -21
- data/spec/unit/plugins/solaris2/dmi_spec.rb +5 -6
- data/spec/unit/plugins/solaris2/filesystem.rb +5 -5
- data/spec/unit/plugins/solaris2/hostname_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/kernel_spec.rb +3 -3
- data/spec/unit/plugins/solaris2/memory_spec.rb +5 -5
- data/spec/unit/plugins/solaris2/network_spec.rb +7 -8
- data/spec/unit/plugins/solaris2/platform_spec.rb +1 -1
- data/spec/unit/plugins/solaris2/virtualization_spec.rb +3 -5
- data/spec/unit/plugins/solaris2/zpools_spec.rb +6 -6
- data/spec/unit/plugins/ssh_host_keys_spec.rb +1 -1
- data/spec/unit/plugins/virtualbox_spec.rb +19 -19
- data/spec/unit/plugins/vmware_spec.rb +28 -28
- data/spec/unit/plugins/windows/cpu_spec.rb +46 -48
- data/spec/unit/plugins/windows/memory_spec.rb +5 -5
- data/spec/unit/plugins/windows/virtualization_spec.rb +163 -163
- data/spec/unit/provides_map_spec.rb +10 -10
- data/spec/unit/runner_spec.rb +10 -10
- data/spec/unit/system_spec.rb +19 -19
- data/spec/unit/util/file_helper_spec.rb +5 -6
- data/spec/unit/util/ip_helper_spec.rb +39 -39
- metadata +31 -4
data/lib/ohai/mixin/string.rb
CHANGED
@@ -23,7 +23,7 @@ class String
|
|
23
23
|
# This should implement the same functionality as underscore method in
|
24
24
|
# ActiveSupport::CoreExtensions::String::Inflections
|
25
25
|
def wmi_underscore
|
26
|
-
|
27
|
-
|
26
|
+
self.gsub(/::/, "/").gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
|
27
|
+
gsub(/([a-z\d])([A-Z])/, '\1_\2').tr("-", "_").downcase
|
28
28
|
end
|
29
29
|
end
|
data/lib/ohai/plugin_config.rb
CHANGED
data/lib/ohai/plugins/aix/cpu.rb
CHANGED
@@ -27,7 +27,7 @@ Ohai.plugin(:CPU) do
|
|
27
27
|
cpu[:total] = shell_out("pmcycles -m").stdout.lines.length
|
28
28
|
|
29
29
|
# The below is only relevent on an LPAR
|
30
|
-
if shell_out(
|
30
|
+
if shell_out("uname -W").stdout.strip == "0"
|
31
31
|
|
32
32
|
# At least one CPU will be available, but we'll wait to increment this later.
|
33
33
|
cpu[:available] = 0
|
@@ -36,7 +36,7 @@ Ohai.plugin(:CPU) do
|
|
36
36
|
#from http://www-01.ibm.com/software/passportadvantage/pvu_terminology_for_customers.html
|
37
37
|
#on AIX number of cores and processors are considered same
|
38
38
|
cpu[:real] = cpu[:cores] = cpudevs.length
|
39
|
-
cpudevs.each.with_index do |c,i|
|
39
|
+
cpudevs.each.with_index do |c, i|
|
40
40
|
name, status, location = c.split
|
41
41
|
index = i.to_s
|
42
42
|
cpu[index] = Mash.new
|
@@ -54,14 +54,14 @@ Ohai.plugin(:Filesystem) do
|
|
54
54
|
oldie[key] ||= Mash.new
|
55
55
|
oldie[key][:mount] = fields[1]
|
56
56
|
oldie[key][:fs_type] = fields[2]
|
57
|
-
oldie[key][:mount_options] = fields[6].split(
|
57
|
+
oldie[key][:mount_options] = fields[6].split(",")
|
58
58
|
# entries occupying the 'Node' column parsed here
|
59
59
|
else
|
60
60
|
key = fields[0] + ":" + fields[1]
|
61
61
|
oldie[key] ||= Mash.new
|
62
62
|
oldie[key][:mount] = fields[1]
|
63
63
|
oldie[key][:fs_type] = fields[3]
|
64
|
-
oldie[key][:mount_options] = fields[7].split(
|
64
|
+
oldie[key][:mount_options] = fields[7].split(",")
|
65
65
|
end
|
66
66
|
end
|
67
67
|
oldie
|
@@ -30,7 +30,7 @@ Ohai.plugin(:Memory) do
|
|
30
30
|
memory[:free] = "#{free_in_mb.to_i * 1024}kB"
|
31
31
|
|
32
32
|
swapinfo = shell_out("swap -s").stdout.split #returns swap info in 4K blocks
|
33
|
-
memory[:swap][
|
34
|
-
memory[:swap][
|
33
|
+
memory[:swap]["total"] = "#{(swapinfo[2].to_i) * 4}kB"
|
34
|
+
memory[:swap]["free"] = "#{(swapinfo[10].to_i) * 4}kB"
|
35
35
|
end
|
36
36
|
end
|
@@ -19,7 +19,7 @@
|
|
19
19
|
#
|
20
20
|
|
21
21
|
Ohai.plugin(:Network) do
|
22
|
-
require
|
22
|
+
require "ipaddr"
|
23
23
|
|
24
24
|
provides "network", "counters/network", "macaddress"
|
25
25
|
|
@@ -27,7 +27,7 @@ Ohai.plugin(:Network) do
|
|
27
27
|
def hex_to_dec_netmask(netmask)
|
28
28
|
# example '0xffff0000' -> '255.255.0.0'
|
29
29
|
dec = netmask[2..3].to_i(16).to_s(10)
|
30
|
-
[4,6,8].each { |n| dec = dec + "." + netmask[n..n+1].to_i(16).to_s(10) }
|
30
|
+
[4, 6, 8].each { |n| dec = dec + "." + netmask[n..n + 1].to_i(16).to_s(10) }
|
31
31
|
dec
|
32
32
|
end
|
33
33
|
|
@@ -53,7 +53,7 @@ Ohai.plugin(:Network) do
|
|
53
53
|
# :default_interface, :default_gateway - route -n get 0
|
54
54
|
so = shell_out("netstat -rn |grep default")
|
55
55
|
so.stdout.lines.each do |line|
|
56
|
-
items = line.split(
|
56
|
+
items = line.split(" ")
|
57
57
|
if items[0] == "default"
|
58
58
|
network[:default_gateway] = items[1]
|
59
59
|
network[:default_interface] = items[5]
|
@@ -68,12 +68,12 @@ Ohai.plugin(:Network) do
|
|
68
68
|
interface = splat[0]
|
69
69
|
line = splat[1..-1][0]
|
70
70
|
iface[interface] = Mash.new
|
71
|
-
iface[interface][:state] = (line.include?("<UP,") ?
|
71
|
+
iface[interface][:state] = (line.include?("<UP,") ? "up" : "down")
|
72
72
|
|
73
73
|
intraface.lines.each do |lin|
|
74
74
|
case lin
|
75
75
|
when /flags=\S+<(\S+)>/
|
76
|
-
iface[interface][:flags] = $1.split(
|
76
|
+
iface[interface][:flags] = $1.split(",")
|
77
77
|
iface[interface][:metric] = $1 if lin =~ /metric\s(\S+)/
|
78
78
|
else
|
79
79
|
# We have key value pairs.
|
@@ -103,9 +103,9 @@ Ohai.plugin(:Network) do
|
|
103
103
|
else
|
104
104
|
# load all key-values, example "tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1"
|
105
105
|
properties = lin.split
|
106
|
-
n = properties.length/2 - 1
|
106
|
+
n = properties.length / 2 - 1
|
107
107
|
(0..n).each do |i|
|
108
|
-
iface[interface][properties[i*2]] = properties[(i*2+1)]
|
108
|
+
iface[interface][properties[i * 2]] = properties[(i * 2 + 1)]
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
@@ -120,7 +120,7 @@ Ohai.plugin(:Network) do
|
|
120
120
|
macaddress $1.upcase unless shell_out("uname -W").stdout.to_i > 0
|
121
121
|
end
|
122
122
|
end
|
123
|
-
end
|
123
|
+
end #ifconfig stdout
|
124
124
|
|
125
125
|
# Query routes information
|
126
126
|
%w{inet inet6}.each do |family|
|
@@ -130,7 +130,7 @@ Ohai.plugin(:Network) do
|
|
130
130
|
interface = $6
|
131
131
|
iface[interface][:routes] = Array.new unless iface[interface][:routes]
|
132
132
|
iface[interface][:routes] << Mash.new( :destination => $1, :family => family,
|
133
|
-
|
133
|
+
:via => $2, :flags => $3)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
@@ -151,4 +151,3 @@ Ohai.plugin(:Network) do
|
|
151
151
|
network["interfaces"] = iface
|
152
152
|
end
|
153
153
|
end
|
154
|
-
|
data/lib/ohai/plugins/aix/os.rb
CHANGED
@@ -21,14 +21,14 @@ Ohai.plugin(:Uptime) do
|
|
21
21
|
provides "uptime", "uptime_seconds"
|
22
22
|
|
23
23
|
collect_data(:aix) do
|
24
|
-
require
|
24
|
+
require "date"
|
25
25
|
# Example output:
|
26
26
|
# $ who -b
|
27
27
|
# . system boot Jul 9 17:51
|
28
|
-
so = shell_out(
|
28
|
+
so = shell_out("who -b")
|
29
29
|
so.stdout.lines.each do |line|
|
30
30
|
if line =~ /.* boot (.+)/
|
31
|
-
uptime_seconds Time.now.to_i - DateTime.parse($1 + " #{Time.now.zone}").strftime(
|
31
|
+
uptime_seconds Time.now.to_i - DateTime.parse($1 + " #{Time.now.zone}").strftime("%s").to_i
|
32
32
|
uptime seconds_to_human(uptime_seconds)
|
33
33
|
break
|
34
34
|
end
|
@@ -56,63 +56,63 @@ Ohai.plugin(:Virtualization) do
|
|
56
56
|
|
57
57
|
sections.each do |line|
|
58
58
|
case title
|
59
|
-
when
|
59
|
+
when "network"
|
60
60
|
next if line =~ /^Interface|^---/
|
61
61
|
splat = line.strip.split
|
62
62
|
key = splat[0].downcase
|
63
63
|
value = {
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
"address" => splat[1],
|
65
|
+
"netmask" => splat[2],
|
66
|
+
"broadcast" => splat[3],
|
67
67
|
}
|
68
68
|
wpars[wpar_name][title][key] = value
|
69
|
-
when
|
69
|
+
when "user-specified routes"
|
70
70
|
next if line =~ /^Type|^---/
|
71
71
|
splat = line.strip.split
|
72
72
|
key = splat[2].downcase
|
73
73
|
value = {
|
74
|
-
|
75
|
-
|
74
|
+
"destination" => splat[0],
|
75
|
+
"gateway" => splat[1],
|
76
76
|
}
|
77
77
|
wpars[wpar_name][title][key] = value
|
78
|
-
when
|
78
|
+
when "file systems"
|
79
79
|
next if line =~ /^MountPoint|^---/
|
80
80
|
splat = line.strip.split
|
81
81
|
key = splat[1].downcase
|
82
82
|
value = {
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
"mountpoint" => splat[0],
|
84
|
+
"device" => splat[1],
|
85
|
+
"vfs" => splat[2],
|
86
|
+
"options" => splat[3].split(","),
|
87
87
|
}
|
88
88
|
wpars[wpar_name][title][key] = value
|
89
|
-
when
|
90
|
-
privileges ||=
|
91
|
-
wpars[wpar_name][title][
|
89
|
+
when "security settings"
|
90
|
+
privileges ||= ""
|
91
|
+
wpars[wpar_name][title]["Privileges"] ||= []
|
92
92
|
|
93
93
|
if line =~ /^Privileges/
|
94
|
-
privileges << line.split(
|
94
|
+
privileges << line.split(":")[1].strip
|
95
95
|
else
|
96
96
|
privileges << line.strip
|
97
97
|
end
|
98
98
|
|
99
|
-
wpars[wpar_name][title][
|
100
|
-
when
|
99
|
+
wpars[wpar_name][title]["Privileges"] += privileges.split(",")
|
100
|
+
when "device exports"
|
101
101
|
next if line =~ /^Name|^---/
|
102
102
|
splat = line.strip.split
|
103
103
|
key = splat[0].downcase
|
104
104
|
value = {
|
105
|
-
|
106
|
-
|
105
|
+
"type" => splat[1],
|
106
|
+
"status" => splat[2],
|
107
107
|
}
|
108
108
|
wpars[wpar_name][title][key] = value
|
109
109
|
else
|
110
110
|
# key-value pairs are handled here
|
111
111
|
# such as GENERAL and RESOURCE-
|
112
112
|
# CONTROL
|
113
|
-
splat = line.strip.split(
|
113
|
+
splat = line.strip.split(":")
|
114
114
|
key = splat[0].downcase
|
115
|
-
value = splat[1..-1].join(
|
115
|
+
value = splat[1..-1].join(", ").strip
|
116
116
|
value = value.empty? ? nil : value
|
117
117
|
case value
|
118
118
|
when "yes"
|
@@ -136,7 +136,7 @@ Ohai.plugin(:Virtualization) do
|
|
136
136
|
|
137
137
|
top_level.each do |attribute|
|
138
138
|
evalstr = "wpars['#{wpar_name}']"
|
139
|
-
breadcrumb = attribute.split(
|
139
|
+
breadcrumb = attribute.split(".")
|
140
140
|
breadcrumb.each do |node|
|
141
141
|
evalstr << "[\'#{node}\']"
|
142
142
|
end
|
data/lib/ohai/plugins/azure.rb
CHANGED
@@ -19,17 +19,44 @@ Ohai.plugin(:Azure) do
|
|
19
19
|
|
20
20
|
collect_data do
|
21
21
|
# The azure hints are populated by the knife plugin for Azure.
|
22
|
-
# The project is located at https://github.com/
|
22
|
+
# The project is located at https://github.com/chef/knife-azure
|
23
23
|
# Please see the lib/chef/knife/azure_server_create.rb file in that
|
24
24
|
# project for details
|
25
|
-
azure_metadata_from_hints = hint?(
|
25
|
+
azure_metadata_from_hints = hint?("azure")
|
26
26
|
if azure_metadata_from_hints
|
27
|
-
Ohai::Log.debug("azure_metadata_from_hints is present.")
|
27
|
+
Ohai::Log.debug("azure plugin: azure_metadata_from_hints is present.")
|
28
|
+
azure Mash.new
|
29
|
+
azure_metadata_from_hints.each { |k, v| azure[k] = v }
|
30
|
+
elsif has_waagent? || has_dhcp_option_245?
|
31
|
+
Ohai::Log.debug("azure plugin: No hints present, but system appears to be on azure.")
|
28
32
|
azure Mash.new
|
29
|
-
azure_metadata_from_hints.each {|k, v| azure[k] = v }
|
30
33
|
else
|
31
|
-
Ohai::Log.debug("No hints present for azure.")
|
34
|
+
Ohai::Log.debug("azure plugin: No hints present for azure and doesn't appear to be azure.")
|
32
35
|
false
|
33
36
|
end
|
34
37
|
end
|
38
|
+
|
39
|
+
# check for either the waagent or the unknown-245 DHCP option that Azure uses
|
40
|
+
# http://blog.mszcool.com/index.php/2015/04/detecting-if-a-virtual-machine-runs-in-microsoft-azure-linux-windows-to-protect-your-software-when-distributed-via-the-azure-marketplace/
|
41
|
+
def has_waagent?
|
42
|
+
if File.exist?("/usr/sbin/waagent") || Dir.exist?('C:\WindowsAzure')
|
43
|
+
Ohai::Log.debug("azure plugin: Found waagent used by MS Azure.")
|
44
|
+
return true
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def has_dhcp_option_245?
|
49
|
+
has_245 = false
|
50
|
+
if File.exist?("/var/lib/dhcp/dhclient.eth0.leases")
|
51
|
+
File.open("/var/lib/dhcp/dhclient.eth0.leases").each do |line|
|
52
|
+
if line =~ /unknown-245/
|
53
|
+
Ohai::Log.debug("azure plugin: Found unknown-245 DHCP option used by MS Azure.")
|
54
|
+
has_245 = true
|
55
|
+
break
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
return has_245
|
60
|
+
end
|
61
|
+
|
35
62
|
end
|
@@ -16,12 +16,12 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "ohai/mixin/dmi_decode"
|
20
20
|
|
21
21
|
include Ohai::Mixin::DmiDecode
|
22
22
|
|
23
23
|
Ohai.plugin(:Virtualization) do
|
24
|
-
provides
|
24
|
+
provides "virtualization"
|
25
25
|
|
26
26
|
collect_data(:freebsd, :openbsd, :netbsd, :dragonflybsd) do
|
27
27
|
|
@@ -33,14 +33,14 @@ Ohai.plugin(:Virtualization) do
|
|
33
33
|
if so.stdout.split($/)[0].to_i == 1
|
34
34
|
virtualization[:system] = "jail"
|
35
35
|
virtualization[:role] = "guest"
|
36
|
-
virtualization[:systems][:jail] =
|
36
|
+
virtualization[:systems][:jail] = "guest"
|
37
37
|
end
|
38
38
|
|
39
|
-
so = shell_out(
|
40
|
-
if (so.stdout ||
|
41
|
-
virtualization[:system] =
|
42
|
-
virtualization[:role] =
|
43
|
-
virtualization[:systems][:jail] =
|
39
|
+
so = shell_out("jls -n")
|
40
|
+
if (so.stdout || "").lines.count >= 1
|
41
|
+
virtualization[:system] = "jail"
|
42
|
+
virtualization[:role] = "host"
|
43
|
+
virtualization[:systems][:jail] = "host"
|
44
44
|
end
|
45
45
|
|
46
46
|
# detect from modules
|
@@ -48,32 +48,32 @@ Ohai.plugin(:Virtualization) do
|
|
48
48
|
so.stdout.lines do |line|
|
49
49
|
case line
|
50
50
|
when /vboxdrv/
|
51
|
-
virtualization[:system] =
|
52
|
-
virtualization[:role] =
|
53
|
-
virtualization[:systems][:vbox] =
|
51
|
+
virtualization[:system] = "vbox"
|
52
|
+
virtualization[:role] = "host"
|
53
|
+
virtualization[:systems][:vbox] = "host"
|
54
54
|
when /vboxguest/
|
55
|
-
virtualization[:system] =
|
56
|
-
virtualization[:role] =
|
57
|
-
virtualization[:systems][:vbox] =
|
55
|
+
virtualization[:system] = "vbox"
|
56
|
+
virtualization[:role] = "guest"
|
57
|
+
virtualization[:systems][:vbox] = "guest"
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
61
|
# Detect KVM/QEMU from cpu, report as KVM
|
62
62
|
# hw.model: QEMU Virtual CPU version 0.9.1
|
63
|
-
so = shell_out(
|
63
|
+
so = shell_out("sysctl -n hw.model")
|
64
64
|
if so.stdout.split($/)[0] =~ /QEMU Virtual CPU|Common KVM processor|Common 32-bit KVM processor/
|
65
|
-
virtualization[:system] =
|
66
|
-
virtualization[:role] =
|
67
|
-
virtualization[:systems][:kvm] =
|
65
|
+
virtualization[:system] = "kvm"
|
66
|
+
virtualization[:role] = "guest"
|
67
|
+
virtualization[:systems][:kvm] = "guest"
|
68
68
|
end
|
69
69
|
|
70
70
|
# parse dmidecode to discover various virtualization guests
|
71
|
-
if File.exist?(
|
72
|
-
guest = guest_from_dmi(shell_out(
|
71
|
+
if File.exist?("/usr/local/sbin/dmidecode") || File.exist?("/usr/pkg/sbin/dmidecode")
|
72
|
+
guest = guest_from_dmi(shell_out("dmidecode").stdout)
|
73
73
|
if guest
|
74
74
|
virtualization[:system] = guest
|
75
|
-
virtualization[:role] =
|
76
|
-
virtualization[:systems][guest.to_sym] =
|
75
|
+
virtualization[:role] = "guest"
|
76
|
+
virtualization[:systems][guest.to_sym] = "guest"
|
77
77
|
end
|
78
78
|
end
|
79
79
|
end
|
data/lib/ohai/plugins/c.rb
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
|
-
#
|
9
|
+
#
|
10
10
|
# http://www.apache.org/licenses/LICENSE-2.0
|
11
|
-
#
|
11
|
+
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
14
14
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@@ -16,7 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
-
require
|
19
|
+
require "rbconfig"
|
20
20
|
|
21
21
|
Ohai.plugin(:C) do
|
22
22
|
provides "languages/c"
|
data/lib/ohai/plugins/chef.rb
CHANGED
@@ -21,7 +21,7 @@ Ohai.plugin(:Chef) do
|
|
21
21
|
|
22
22
|
collect_data do
|
23
23
|
begin
|
24
|
-
require
|
24
|
+
require "chef/version"
|
25
25
|
rescue Gem::LoadError
|
26
26
|
# this catches when you've done a major version bump of ohai, but
|
27
27
|
# your chef gem is incompatible, so we can't load it in the same VM
|
data/lib/ohai/plugins/cloud.rb
CHANGED
@@ -52,22 +52,22 @@ Ohai.plugin(:Cloud) do
|
|
52
52
|
cloud[:public_ipv4] = []
|
53
53
|
cloud[:local_ipv4] = []
|
54
54
|
|
55
|
-
public_ips = gce[
|
56
|
-
if interface.has_key?(
|
57
|
-
interface[
|
55
|
+
public_ips = gce["instance"]["networkInterfaces"].collect do |interface|
|
56
|
+
if interface.has_key?("accessConfigs")
|
57
|
+
interface["accessConfigs"].collect { |ac| ac["externalIp"] }
|
58
58
|
end
|
59
59
|
end.flatten.compact
|
60
60
|
|
61
|
-
private_ips = gce[
|
62
|
-
interface[
|
61
|
+
private_ips = gce["instance"]["networkInterfaces"].collect do |interface|
|
62
|
+
interface["ip"]
|
63
63
|
end.compact
|
64
64
|
|
65
65
|
cloud[:public_ips] += public_ips
|
66
66
|
cloud[:private_ips] += private_ips
|
67
|
-
cloud[:public_ipv4] +=
|
67
|
+
cloud[:public_ipv4] += public_ips
|
68
68
|
cloud[:public_hostname] = nil
|
69
69
|
cloud[:local_ipv4] += private_ips
|
70
|
-
cloud[:local_hostname] = gce[
|
70
|
+
cloud[:local_hostname] = gce["instance"]["hostname"]
|
71
71
|
cloud[:provider] = "gce"
|
72
72
|
end
|
73
73
|
|
@@ -86,12 +86,12 @@ Ohai.plugin(:Cloud) do
|
|
86
86
|
|
87
87
|
# Fill cloud hash with ec2 values
|
88
88
|
def get_ec2_values
|
89
|
-
cloud[:public_ips] << ec2[
|
90
|
-
cloud[:private_ips] << ec2[
|
91
|
-
cloud[:public_ipv4] = ec2[
|
92
|
-
cloud[:public_hostname] = ec2[
|
93
|
-
cloud[:local_ipv4] = ec2[
|
94
|
-
cloud[:local_hostname] = ec2[
|
89
|
+
cloud[:public_ips] << ec2["public_ipv4"]
|
90
|
+
cloud[:private_ips] << ec2["local_ipv4"]
|
91
|
+
cloud[:public_ipv4] = ec2["public_ipv4"]
|
92
|
+
cloud[:public_hostname] = ec2["public_hostname"]
|
93
|
+
cloud[:local_ipv4] = ec2["local_ipv4"]
|
94
|
+
cloud[:local_hostname] = ec2["local_hostname"]
|
95
95
|
cloud[:provider] = "ec2"
|
96
96
|
end
|
97
97
|
|
@@ -110,14 +110,14 @@ Ohai.plugin(:Cloud) do
|
|
110
110
|
|
111
111
|
# Fill cloud hash with rackspace values
|
112
112
|
def get_rackspace_values
|
113
|
-
cloud[:public_ips] << rackspace[
|
114
|
-
cloud[:private_ips] << rackspace[
|
115
|
-
cloud[:public_ipv4] = rackspace[
|
116
|
-
cloud[:public_ipv6] = rackspace[
|
117
|
-
cloud[:public_hostname] = rackspace[
|
118
|
-
cloud[:local_ipv4] = rackspace[
|
119
|
-
cloud[:local_ipv6] = rackspace[
|
120
|
-
cloud[:local_hostname] = rackspace[
|
113
|
+
cloud[:public_ips] << rackspace["public_ipv4"] if rackspace["public_ipv4"]
|
114
|
+
cloud[:private_ips] << rackspace["local_ipv4"] if rackspace["local_ipv4"]
|
115
|
+
cloud[:public_ipv4] = rackspace["public_ipv4"]
|
116
|
+
cloud[:public_ipv6] = rackspace["public_ipv6"]
|
117
|
+
cloud[:public_hostname] = rackspace["public_hostname"]
|
118
|
+
cloud[:local_ipv4] = rackspace["local_ipv4"]
|
119
|
+
cloud[:local_ipv6] = rackspace["local_ipv6"]
|
120
|
+
cloud[:local_hostname] = rackspace["local_hostname"]
|
121
121
|
cloud[:provider] = "rackspace"
|
122
122
|
end
|
123
123
|
|
@@ -136,12 +136,12 @@ Ohai.plugin(:Cloud) do
|
|
136
136
|
|
137
137
|
# Fill cloud hash with linode values
|
138
138
|
def get_linode_values
|
139
|
-
cloud[:public_ips] << linode[
|
140
|
-
cloud[:private_ips] << linode[
|
141
|
-
cloud[:public_ipv4] = linode[
|
142
|
-
cloud[:public_hostname] = linode[
|
143
|
-
cloud[:local_ipv4] = linode[
|
144
|
-
cloud[:local_hostname] = linode[
|
139
|
+
cloud[:public_ips] << linode["public_ip"]
|
140
|
+
cloud[:private_ips] << linode["private_ip"]
|
141
|
+
cloud[:public_ipv4] = linode["public_ipv4"]
|
142
|
+
cloud[:public_hostname] = linode["public_hostname"]
|
143
|
+
cloud[:local_ipv4] = linode["local_ipv4"]
|
144
|
+
cloud[:local_hostname] = linode["local_hostname"]
|
145
145
|
cloud[:provider] = "linode"
|
146
146
|
end
|
147
147
|
|
@@ -159,12 +159,12 @@ Ohai.plugin(:Cloud) do
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def get_eucalyptus_values
|
162
|
-
cloud[:public_ips] << eucalyptus[
|
163
|
-
cloud[:private_ips] << eucalyptus[
|
164
|
-
cloud[:public_ipv4] = eucalyptus[
|
165
|
-
cloud[:public_hostname] = eucalyptus[
|
166
|
-
cloud[:local_ipv4] = eucalyptus[
|
167
|
-
cloud[:local_hostname] = eucalyptus[
|
162
|
+
cloud[:public_ips] << eucalyptus["public_ipv4"]
|
163
|
+
cloud[:private_ips] << eucalyptus["local_ipv4"]
|
164
|
+
cloud[:public_ipv4] = eucalyptus["public_ipv4"]
|
165
|
+
cloud[:public_hostname] = eucalyptus["public_hostname"]
|
166
|
+
cloud[:local_ipv4] = eucalyptus["local_ipv4"]
|
167
|
+
cloud[:local_hostname] = eucalyptus["local_hostname"]
|
168
168
|
cloud[:provider] = "eucalyptus"
|
169
169
|
end
|
170
170
|
|
@@ -183,13 +183,13 @@ Ohai.plugin(:Cloud) do
|
|
183
183
|
|
184
184
|
# Fill cloud hash with openstack values
|
185
185
|
def get_openstack_values
|
186
|
-
cloud[:public_ips] << openstack[
|
187
|
-
cloud[:private_ips] << openstack[
|
188
|
-
cloud[:public_ipv4] = openstack[
|
189
|
-
cloud[:public_hostname] = openstack[
|
190
|
-
cloud[:local_ipv4] = openstack[
|
191
|
-
cloud[:local_hostname] = openstack[
|
192
|
-
cloud[:provider] = openstack[
|
186
|
+
cloud[:public_ips] << openstack["public_ipv4"]
|
187
|
+
cloud[:private_ips] << openstack["local_ipv4"]
|
188
|
+
cloud[:public_ipv4] = openstack["public_ipv4"]
|
189
|
+
cloud[:public_hostname] = openstack["public_hostname"]
|
190
|
+
cloud[:local_ipv4] = openstack["local_ipv4"]
|
191
|
+
cloud[:local_hostname] = openstack["local_hostname"]
|
192
|
+
cloud[:provider] = openstack["provider"]
|
193
193
|
end
|
194
194
|
|
195
195
|
# ----------------------------------------
|
@@ -208,12 +208,12 @@ Ohai.plugin(:Cloud) do
|
|
208
208
|
# Fill cloud hash with azure values
|
209
209
|
def get_azure_values
|
210
210
|
cloud[:vm_name] = azure["vm_name"]
|
211
|
-
cloud[:public_ips] << azure[
|
212
|
-
cloud[:public_ipv4] = azure[
|
213
|
-
cloud[:public_fqdn] = azure[
|
214
|
-
cloud[:public_hostname] = azure[
|
215
|
-
cloud[:public_ssh_port] = azure[
|
216
|
-
cloud[:public_winrm_port] = azure[
|
211
|
+
cloud[:public_ips] << azure["public_ip"]
|
212
|
+
cloud[:public_ipv4] = azure["public_ip"]
|
213
|
+
cloud[:public_fqdn] = azure["public_fqdn"]
|
214
|
+
cloud[:public_hostname] = azure["public_fqdn"]
|
215
|
+
cloud[:public_ssh_port] = azure["public_ssh_port"] if azure["public_ssh_port"]
|
216
|
+
cloud[:public_winrm_port] = azure["public_winrm_port"] if azure["public_winrm_port"]
|
217
217
|
cloud[:provider] = "azure"
|
218
218
|
end
|
219
219
|
|
@@ -232,17 +232,17 @@ Ohai.plugin(:Cloud) do
|
|
232
232
|
|
233
233
|
# Fill cloud hash with linode values
|
234
234
|
def get_digital_ocean_values
|
235
|
-
public_ipv4 = digital_ocean[
|
236
|
-
private_ipv4 = digital_ocean[
|
237
|
-
public_ipv6 = digital_ocean[
|
238
|
-
private_ipv6 = digital_ocean[
|
239
|
-
cloud[:public_ips].concat public_ipv4+public_ipv6
|
240
|
-
cloud[:private_ips].concat private_ipv4+private_ipv6
|
235
|
+
public_ipv4 = digital_ocean["networks"]["v4"].select { |address| address["type"] == "public" }
|
236
|
+
private_ipv4 = digital_ocean["networks"]["v4"].select { |address| address["type"] == "private" }
|
237
|
+
public_ipv6 = digital_ocean["networks"]["v6"].select { |address| address["type"] == "public" }
|
238
|
+
private_ipv6 = digital_ocean["networks"]["v6"].select { |address| address["type"] == "private" }
|
239
|
+
cloud[:public_ips].concat public_ipv4 + public_ipv6
|
240
|
+
cloud[:private_ips].concat private_ipv4 + private_ipv6
|
241
241
|
cloud[:public_ipv4] = public_ipv4.first
|
242
242
|
cloud[:public_ipv6] = public_ipv6.first
|
243
243
|
cloud[:local_ipv4] = private_ipv4.first
|
244
244
|
cloud[:local_ipv6] = private_ipv6.first
|
245
|
-
cloud[:public_hostname] = digital_ocean[
|
245
|
+
cloud[:public_hostname] = digital_ocean["name"]
|
246
246
|
cloud[:provider] = "digital_ocean"
|
247
247
|
end
|
248
248
|
|
@@ -261,15 +261,14 @@ Ohai.plugin(:Cloud) do
|
|
261
261
|
|
262
262
|
# Fill cloud hash with softlayer values
|
263
263
|
def get_softlayer_values
|
264
|
-
cloud[:public_ipv4] = softlayer[
|
265
|
-
cloud[:local_ipv4] = softlayer[
|
266
|
-
cloud[:public_ips] << softlayer[
|
267
|
-
cloud[:private_ips] << softlayer[
|
268
|
-
cloud[:public_hostname] = softlayer[
|
269
|
-
cloud[:provider] =
|
264
|
+
cloud[:public_ipv4] = softlayer["public_ipv4"]
|
265
|
+
cloud[:local_ipv4] = softlayer["local_ipv4"]
|
266
|
+
cloud[:public_ips] << softlayer["public_ipv4"] if softlayer["public_ipv4"]
|
267
|
+
cloud[:private_ips] << softlayer["local_ipv4"] if softlayer["local_ipv4"]
|
268
|
+
cloud[:public_hostname] = softlayer["public_fqdn"]
|
269
|
+
cloud[:provider] = "softlayer"
|
270
270
|
end
|
271
271
|
|
272
|
-
|
273
272
|
collect_data do
|
274
273
|
# setup gce cloud
|
275
274
|
if on_gce?
|