ohai 16.7.18 → 16.10.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/lib/ohai/dsl/plugin.rb +1 -1
- data/lib/ohai/dsl/plugin/versionvii.rb +0 -2
- data/lib/ohai/mixin/azure_metadata.rb +2 -2
- data/lib/ohai/mixin/ec2_metadata.rb +35 -10
- data/lib/ohai/mixin/gce_metadata.rb +1 -1
- data/lib/ohai/plugins/aix/kernel.rb +6 -4
- data/lib/ohai/plugins/aix/memory.rb +3 -3
- data/lib/ohai/plugins/aix/network.rb +50 -58
- data/lib/ohai/plugins/aix/platform.rb +2 -2
- data/lib/ohai/plugins/aix/virtualization.rb +6 -6
- data/lib/ohai/plugins/bsd/virtualization.rb +1 -1
- data/lib/ohai/plugins/c.rb +3 -3
- data/lib/ohai/plugins/cloud.rb +1 -1
- data/lib/ohai/plugins/cpu.rb +25 -25
- data/lib/ohai/plugins/darwin/network.rb +7 -9
- data/lib/ohai/plugins/digital_ocean.rb +2 -1
- data/lib/ohai/plugins/dmi.rb +4 -4
- data/lib/ohai/plugins/docker.rb +1 -1
- data/lib/ohai/plugins/dragonflybsd/memory.rb +8 -8
- data/lib/ohai/plugins/dragonflybsd/platform.rb +2 -2
- data/lib/ohai/plugins/ec2.rb +3 -0
- data/lib/ohai/plugins/eucalyptus.rb +1 -1
- data/lib/ohai/plugins/freebsd/memory.rb +8 -8
- data/lib/ohai/plugins/freebsd/platform.rb +2 -2
- data/lib/ohai/plugins/grub2.rb +40 -0
- data/lib/ohai/plugins/hostname.rb +1 -2
- data/lib/ohai/plugins/kernel.rb +5 -7
- data/lib/ohai/plugins/libvirt.rb +3 -3
- data/lib/ohai/plugins/linode.rb +21 -14
- data/lib/ohai/plugins/linux/lspci.rb +0 -1
- data/lib/ohai/plugins/linux/network.rb +29 -4
- data/lib/ohai/plugins/linux/platform.rb +4 -1
- data/lib/ohai/plugins/netbsd/platform.rb +2 -2
- data/lib/ohai/plugins/network.rb +1 -1
- data/lib/ohai/plugins/openbsd/platform.rb +2 -2
- data/lib/ohai/plugins/os.rb +1 -1
- data/lib/ohai/plugins/packages.rb +1 -1
- data/lib/ohai/plugins/passwd.rb +1 -1
- data/lib/ohai/plugins/rackspace.rb +4 -4
- data/lib/ohai/plugins/scaleway.rb +1 -1
- data/lib/ohai/plugins/scsi.rb +0 -1
- data/lib/ohai/plugins/solaris2/network.rb +1 -1
- data/lib/ohai/plugins/solaris2/virtualization.rb +1 -2
- data/lib/ohai/plugins/train.rb +0 -1
- data/lib/ohai/plugins/uptime.rb +1 -1
- data/lib/ohai/plugins/virtualbox.rb +1 -1
- data/lib/ohai/plugins/vmware.rb +1 -2
- data/lib/ohai/plugins/zpools.rb +0 -1
- data/lib/ohai/util/ip_helper.rb +1 -1
- data/lib/ohai/version.rb +1 -1
- data/ohai.gemspec +1 -1
- metadata +14 -14
- data/lib/ohai/plugins/joyent.rb +0 -78
@@ -154,7 +154,7 @@ Ohai.plugin(:Network) do
|
|
154
154
|
def ethernet_layer_one(iface)
|
155
155
|
return iface unless ethtool_binary_path
|
156
156
|
|
157
|
-
keys = %w{
|
157
|
+
keys = %w{Speed Duplex Port Transceiver Auto-negotiation MDI-X}
|
158
158
|
iface.each_key do |tmp_int|
|
159
159
|
next unless iface[tmp_int][:encapsulation] == "Ethernet"
|
160
160
|
|
@@ -273,6 +273,30 @@ Ohai.plugin(:Network) do
|
|
273
273
|
iface
|
274
274
|
end
|
275
275
|
|
276
|
+
# determine pause parameters for the interface using ethtool
|
277
|
+
def ethernet_pause_parameters(iface)
|
278
|
+
return iface unless ethtool_binary_path
|
279
|
+
|
280
|
+
iface.each_key do |tmp_int|
|
281
|
+
next unless iface[tmp_int][:encapsulation] == "Ethernet"
|
282
|
+
|
283
|
+
so = shell_out("#{ethtool_binary_path} -a #{tmp_int}")
|
284
|
+
logger.trace("Plugin Network: Parsing ethtool output: #{so.stdout}")
|
285
|
+
iface[tmp_int]["pause_params"] = {}
|
286
|
+
so.stdout.lines.each do |line|
|
287
|
+
next if line.start_with?("Pause parameters for")
|
288
|
+
next if line.strip.nil?
|
289
|
+
|
290
|
+
key, val = line.split(/:\s+/)
|
291
|
+
if val
|
292
|
+
pause_key = "#{key.downcase.tr(" ", "_")}"
|
293
|
+
iface[tmp_int]["pause_params"][pause_key] = val.strip.eql? "on"
|
294
|
+
end
|
295
|
+
end
|
296
|
+
end
|
297
|
+
iface
|
298
|
+
end
|
299
|
+
|
276
300
|
# determine driver info for the interface using ethtool
|
277
301
|
def ethernet_driver_info(iface)
|
278
302
|
return iface unless ethtool_binary_path
|
@@ -385,7 +409,7 @@ Ohai.plugin(:Network) do
|
|
385
409
|
if line =~ IPROUTE_INT_REGEX
|
386
410
|
cint = $2
|
387
411
|
iface[cint] = Mash.new
|
388
|
-
if cint =~ /^(\w
|
412
|
+
if cint =~ /^(\w+?)(\d+.*)/
|
389
413
|
iface[cint][:type] = $1
|
390
414
|
iface[cint][:number] = $2
|
391
415
|
end
|
@@ -466,7 +490,7 @@ Ohai.plugin(:Network) do
|
|
466
490
|
iface[cint][:addresses] ||= Mash.new
|
467
491
|
tmp_addr = $1
|
468
492
|
tags = $4 || ""
|
469
|
-
tags = tags.split
|
493
|
+
tags = tags.split
|
470
494
|
|
471
495
|
iface[cint][:addresses][tmp_addr] = {
|
472
496
|
"family" => "inet6",
|
@@ -696,7 +720,7 @@ Ohai.plugin(:Network) do
|
|
696
720
|
if line =~ /^([0-9a-zA-Z@\.\:\-_]+)\s+/
|
697
721
|
cint = $1
|
698
722
|
iface[cint] = Mash.new
|
699
|
-
if cint =~ /^(\w
|
723
|
+
if cint =~ /^(\w+?)(\d+.*)/
|
700
724
|
iface[cint][:type] = $1
|
701
725
|
iface[cint][:number] = $2
|
702
726
|
end
|
@@ -770,6 +794,7 @@ Ohai.plugin(:Network) do
|
|
770
794
|
iface = ethernet_channel_parameters(iface)
|
771
795
|
iface = ethernet_coalesce_parameters(iface)
|
772
796
|
iface = ethernet_driver_info(iface)
|
797
|
+
iface = ethernet_pause_parameters(iface)
|
773
798
|
counters[:network][:interfaces] = net_counters
|
774
799
|
network["interfaces"] = iface
|
775
800
|
end
|
@@ -136,7 +136,7 @@ Ohai.plugin(:Platform) do
|
|
136
136
|
when /debian/, /ubuntu/, /linuxmint/, /raspbian/, /cumulus/, /kali/, /pop/
|
137
137
|
# apt-get+dpkg almost certainly goes here
|
138
138
|
"debian"
|
139
|
-
when /oracle/, /centos/, /redhat/, /scientific/, /enterpriseenterprise/, /xcp/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
|
139
|
+
when /oracle/, /centos/, /redhat/, /almalinux/, /scientific/, /enterpriseenterprise/, /xcp/, /xenserver/, /cloudlinux/, /ibm_powerkvm/, /parallels/, /nexus_centos/, /clearos/, /bigip/ # Note that 'enterpriseenterprise' is oracle's LSB "distributor ID"
|
140
140
|
# NOTE: "rhel" should be reserved exclusively for recompiled rhel versions that are nearly perfectly compatible down to the platform_version.
|
141
141
|
# The operating systems that are "rhel" should all be as compatible as rhel7 = centos7 = oracle7 = scientific7 (98%-ish core RPM version compatibility
|
142
142
|
# and the version numbers MUST track the upstream). The appropriate EPEL version repo should work nearly perfectly. Some variation like the
|
@@ -287,6 +287,9 @@ Ohai.plugin(:Platform) do
|
|
287
287
|
# centos only includes the major version in os-release for some reason
|
288
288
|
if os_release_info["ID"] == "centos"
|
289
289
|
get_redhatish_version(file_read("/etc/redhat-release").chomp)
|
290
|
+
# debian testing and unstable don't have VERSION_ID set
|
291
|
+
elsif os_release_info["ID"] == "debian"
|
292
|
+
os_release_info["VERSION_ID"] || file_read("/etc/debian_version").chomp
|
290
293
|
else
|
291
294
|
os_release_info["VERSION_ID"] || shell_out("/bin/uname -r").stdout.strip
|
292
295
|
end
|
@@ -21,8 +21,8 @@ Ohai.plugin(:Platform) do
|
|
21
21
|
provides "platform", "platform_version", "platform_family"
|
22
22
|
|
23
23
|
collect_data(:netbsd) do
|
24
|
-
platform shell_out("uname -s").stdout.
|
25
|
-
platform_version shell_out("uname -r").stdout.
|
24
|
+
platform shell_out("uname -s").stdout.strip.downcase
|
25
|
+
platform_version shell_out("uname -r").stdout.strip
|
26
26
|
platform_family "netbsd"
|
27
27
|
end
|
28
28
|
end
|
data/lib/ohai/plugins/network.rb
CHANGED
@@ -39,7 +39,7 @@ Ohai.plugin(:NetworkAddresses) do
|
|
39
39
|
next if iface_v.nil? || !iface_v.key?("addresses")
|
40
40
|
|
41
41
|
iface_v["addresses"].each do |addr, addr_v|
|
42
|
-
next if addr_v.nil? || (
|
42
|
+
next if addr_v.nil? || (!addr_v.key? "family") || addr_v["family"] != family
|
43
43
|
|
44
44
|
ipaddresses << {
|
45
45
|
ipaddress: addr_v["prefixlen"] ? IPAddress("#{addr}/#{addr_v["prefixlen"]}") : IPAddress("#{addr}/#{addr_v["netmask"]}"),
|
@@ -21,8 +21,8 @@ Ohai.plugin(:Platform) do
|
|
21
21
|
provides "platform", "platform_version", "platform_family"
|
22
22
|
|
23
23
|
collect_data(:openbsd) do
|
24
|
-
platform shell_out("uname -s").stdout.
|
25
|
-
platform_version shell_out("uname -r").stdout.
|
24
|
+
platform shell_out("uname -s").stdout.strip.downcase
|
25
|
+
platform_version shell_out("uname -r").stdout.strip
|
26
26
|
platform_family "openbsd"
|
27
27
|
end
|
28
28
|
end
|
data/lib/ohai/plugins/os.rb
CHANGED
@@ -35,7 +35,7 @@ Ohai.plugin(:OS) do
|
|
35
35
|
|
36
36
|
# This is __DragonFly_version / __FreeBSD_version. See sys/param.h or
|
37
37
|
# http://www.freebsd.org/doc/en/books/porters-handbook/freebsd-versions.html.
|
38
|
-
os_version shell_out("sysctl -n kern.osreldate").stdout.
|
38
|
+
os_version shell_out("sysctl -n kern.osreldate").stdout.strip
|
39
39
|
end
|
40
40
|
|
41
41
|
collect_data(:target) do
|
data/lib/ohai/plugins/passwd.rb
CHANGED
@@ -91,7 +91,7 @@ Ohai.plugin(:Passwd) do
|
|
91
91
|
if info.keys.any? { |x| x.match?("Win32_UserAccount") }
|
92
92
|
mi["type"] = :user
|
93
93
|
else
|
94
|
-
#
|
94
|
+
# NOTE: the type here is actually Win32_SystemAccount, because,
|
95
95
|
# that's what groups are in the Windows universe.
|
96
96
|
mi["type"] = :group
|
97
97
|
end
|
@@ -161,10 +161,10 @@ Ohai.plugin(:Rackspace) do
|
|
161
161
|
get_global_ipv6_address(:public_ipv6, :eth0)
|
162
162
|
unless rackspace[:public_ip].nil?
|
163
163
|
rackspace[:public_hostname] = begin
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
164
|
+
Resolv.getname(rackspace[:public_ip])
|
165
|
+
rescue Resolv::ResolvError, Resolv::ResolvTimeout
|
166
|
+
rackspace[:public_ip]
|
167
|
+
end
|
168
168
|
end
|
169
169
|
rackspace[:local_ipv4] = rackspace[:private_ip]
|
170
170
|
get_global_ipv6_address(:local_ipv6, :eth1)
|
data/lib/ohai/plugins/scsi.rb
CHANGED
@@ -127,7 +127,7 @@ Ohai.plugin(:Network) do
|
|
127
127
|
end
|
128
128
|
if line =~ /\s+inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) netmask (([0-9a-f]){1,8}) broadcast (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/
|
129
129
|
iface[cint][:addresses] ||= Mash.new
|
130
|
-
iface[cint][:addresses][$1] = { "family" => "inet", "netmask" => hex_to_dec_netmask($2)
|
130
|
+
iface[cint][:addresses][$1] = { "family" => "inet", "netmask" => hex_to_dec_netmask($2), "broadcast" => $4 }
|
131
131
|
end
|
132
132
|
if line =~ %r{\s+inet6 ([a-f0-9\:]+)(\s*|(\%[a-z0-9]+)\s*)/(\d+)\s*$}
|
133
133
|
iface[cint][:addresses] ||= Mash.new
|
@@ -69,12 +69,11 @@ Ohai.plugin(:Virtualization) do
|
|
69
69
|
|
70
70
|
if zones.length == 1
|
71
71
|
first_zone = zones.keys[0]
|
72
|
+
virtualization[:system] = "zone"
|
72
73
|
if first_zone == "global"
|
73
|
-
virtualization[:system] = "zone"
|
74
74
|
virtualization[:role] = "host"
|
75
75
|
virtualization[:systems][:zone] = "host"
|
76
76
|
else
|
77
|
-
virtualization[:system] = "zone"
|
78
77
|
virtualization[:role] = "guest"
|
79
78
|
virtualization[:systems][:zone] = "guest"
|
80
79
|
virtualization[:guest_uuid] = zones[first_zone]["uuid"]
|
data/lib/ohai/plugins/train.rb
CHANGED
data/lib/ohai/plugins/uptime.rb
CHANGED
@@ -55,7 +55,7 @@ Ohai.plugin(:Uptime) do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
collect_data(:linux) do
|
58
|
-
uptime, idletime = file_open("/proc/uptime").gets.split
|
58
|
+
uptime, idletime = file_open("/proc/uptime").gets.split
|
59
59
|
uptime_seconds uptime.to_i
|
60
60
|
uptime seconds_to_human(uptime.to_i)
|
61
61
|
idletime_seconds idletime.to_i
|
@@ -128,7 +128,7 @@ Ohai.plugin(:Virtualbox) do
|
|
128
128
|
logger.trace("Plugin VboxHost: Could not run '#{so_cmd}'. Skipping data")
|
129
129
|
end
|
130
130
|
|
131
|
-
collect_data(:
|
131
|
+
collect_data(:windows, :linux, :solaris2, :darwin) do
|
132
132
|
case virtualization.dig("systems", "vbox")
|
133
133
|
when "guest"
|
134
134
|
logger.trace("Plugin Virtualbox: Node detected as vbox guest. Collecting guest data.")
|
data/lib/ohai/plugins/vmware.rb
CHANGED
data/lib/ohai/plugins/zpools.rb
CHANGED
@@ -46,7 +46,6 @@ Ohai.plugin(:Zpools) do
|
|
46
46
|
pools[$1][:zpool_version] = sanitize_value($8)
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
50
49
|
rescue Ohai::Exceptions::Exec
|
51
50
|
Ohai::Log.debug('Plugin Zpools: Could not shell_out "zpool list -H -o name,size,alloc,free,cap,dedup,health,version". Skipping plugin.')
|
52
51
|
end
|
data/lib/ohai/util/ip_helper.rb
CHANGED
@@ -33,7 +33,7 @@ module Ohai
|
|
33
33
|
IPV6_LINK_LOCAL_UNICAST_BLOCK.include?(ip) || IPV6_PRIVATE_ADDRESS_BLOCK.include?(ip)
|
34
34
|
end
|
35
35
|
end
|
36
|
-
alias
|
36
|
+
alias unique_local_address? private_address?
|
37
37
|
|
38
38
|
def public_address?(addr)
|
39
39
|
!private_address?(addr)
|
data/lib/ohai/version.rb
CHANGED
data/ohai.gemspec
CHANGED
@@ -24,8 +24,8 @@ Gem::Specification.new do |s|
|
|
24
24
|
s.add_dependency "mixlib-log", ">= 2.0.1", "< 4.0"
|
25
25
|
s.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
|
26
26
|
s.add_dependency "plist", "~> 3.1"
|
27
|
-
s.add_dependency "wmi-lite", "~> 1.0"
|
28
27
|
s.add_dependency "train-core"
|
28
|
+
s.add_dependency "wmi-lite", "~> 1.0"
|
29
29
|
# Note for ohai developers: If chef-config causes you grief, try:
|
30
30
|
# bundle install --with development
|
31
31
|
# this should work as long as chef is a development dependency in Gemfile.
|
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: 16.7
|
4
|
+
version: 16.10.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -181,33 +181,33 @@ dependencies:
|
|
181
181
|
- !ruby/object:Gem::Version
|
182
182
|
version: '3.1'
|
183
183
|
- !ruby/object:Gem::Dependency
|
184
|
-
name:
|
184
|
+
name: train-core
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
|
-
- - "
|
187
|
+
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: '
|
189
|
+
version: '0'
|
190
190
|
type: :runtime
|
191
191
|
prerelease: false
|
192
192
|
version_requirements: !ruby/object:Gem::Requirement
|
193
193
|
requirements:
|
194
|
-
- - "
|
194
|
+
- - ">="
|
195
195
|
- !ruby/object:Gem::Version
|
196
|
-
version: '
|
196
|
+
version: '0'
|
197
197
|
- !ruby/object:Gem::Dependency
|
198
|
-
name:
|
198
|
+
name: wmi-lite
|
199
199
|
requirement: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
|
-
- - "
|
201
|
+
- - "~>"
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
version: '0'
|
203
|
+
version: '1.0'
|
204
204
|
type: :runtime
|
205
205
|
prerelease: false
|
206
206
|
version_requirements: !ruby/object:Gem::Requirement
|
207
207
|
requirements:
|
208
|
-
- - "
|
208
|
+
- - "~>"
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: '0'
|
210
|
+
version: '1.0'
|
211
211
|
description: Ohai profiles your system and emits JSON
|
212
212
|
email: adam@chef.io
|
213
213
|
executables:
|
@@ -285,11 +285,11 @@ files:
|
|
285
285
|
- lib/ohai/plugins/gce.rb
|
286
286
|
- lib/ohai/plugins/go.rb
|
287
287
|
- lib/ohai/plugins/groovy.rb
|
288
|
+
- lib/ohai/plugins/grub2.rb
|
288
289
|
- lib/ohai/plugins/haskell.rb
|
289
290
|
- lib/ohai/plugins/hostname.rb
|
290
291
|
- lib/ohai/plugins/init_package.rb
|
291
292
|
- lib/ohai/plugins/java.rb
|
292
|
-
- lib/ohai/plugins/joyent.rb
|
293
293
|
- lib/ohai/plugins/kernel.rb
|
294
294
|
- lib/ohai/plugins/keys.rb
|
295
295
|
- lib/ohai/plugins/languages.rb
|
@@ -391,7 +391,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
391
|
- !ruby/object:Gem::Version
|
392
392
|
version: '0'
|
393
393
|
requirements: []
|
394
|
-
rubygems_version: 3.
|
394
|
+
rubygems_version: 3.1.4
|
395
395
|
signing_key:
|
396
396
|
specification_version: 4
|
397
397
|
summary: Ohai profiles your system and emits JSON
|
data/lib/ohai/plugins/joyent.rb
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
#
|
3
|
-
# Author: sawanoboriyu@higanworks.com
|
4
|
-
# Copyright (C) 2014 HiganWorks LLC
|
5
|
-
# License:: Apache License, Version 2.0
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
#
|
20
|
-
|
21
|
-
# Reference from: sm-summary command
|
22
|
-
|
23
|
-
Ohai.plugin(:Joyent) do
|
24
|
-
provides "joyent"
|
25
|
-
provides "virtualization/guest_id"
|
26
|
-
depends "os", "platform", "virtualization"
|
27
|
-
|
28
|
-
def collect_product_file
|
29
|
-
data = file_read("/etc/product") rescue nil
|
30
|
-
if data
|
31
|
-
data.strip.split("\n")
|
32
|
-
else
|
33
|
-
[]
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def collect_pkgsrc
|
38
|
-
data = file_read("/opt/local/etc/pkg_install.conf") rescue nil
|
39
|
-
if data
|
40
|
-
/PKG_PATH=(.*)/.match(data)[1] rescue nil
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def is_smartos?
|
45
|
-
platform == "smartos"
|
46
|
-
end
|
47
|
-
|
48
|
-
collect_data do
|
49
|
-
if is_smartos?
|
50
|
-
joyent Mash.new
|
51
|
-
|
52
|
-
# copy uuid
|
53
|
-
joyent[:sm_uuid] = virtualization[:guest_uuid]
|
54
|
-
|
55
|
-
# get zone id unless globalzone
|
56
|
-
unless joyent[:sm_uuid] == "global"
|
57
|
-
joyent[:sm_id] = virtualization[:guest_id]
|
58
|
-
end
|
59
|
-
|
60
|
-
# retrieve image name and pkgsrc
|
61
|
-
collect_product_file.each do |line|
|
62
|
-
case line
|
63
|
-
when /^Image/
|
64
|
-
sm_image = line.split(" ")
|
65
|
-
joyent[:sm_image_id] = sm_image[1]
|
66
|
-
joyent[:sm_image_ver] = sm_image[2]
|
67
|
-
when /^Base Image/
|
68
|
-
sm_baseimage = line.split(" ")
|
69
|
-
joyent[:sm_baseimage_id] = sm_baseimage[2]
|
70
|
-
joyent[:sm_baseimage_ver] = sm_baseimage[3]
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
## retrieve pkgsrc
|
75
|
-
joyent[:sm_pkgsrc] = collect_pkgsrc
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|