lib/ohai/plugins/joyent.rb in ohai-8.10.0 vs lib/ohai/plugins/joyent.rb in ohai-8.11.1

- old
+ new

@@ -18,13 +18,13 @@ # # Reference from: sm-summary command Ohai.plugin(:Joyent) do - provides 'joyent' - provides 'virtualization/guest_id' - depends 'os', 'platform', 'virtualization' + provides "joyent" + provides "virtualization/guest_id" + depends "os", "platform", "virtualization" def collect_product_file lines = [] if ::File.exists?("/etc/product") ::File.open("/etc/product") do |file| @@ -35,20 +35,20 @@ end lines end def collect_pkgsrc - if File.exist?('/opt/local/etc/pkg_install.conf') + if File.exist?("/opt/local/etc/pkg_install.conf") sm_pkgsrc = ::File.read("/opt/local/etc/pkg_install.conf").split("=") sm_pkgsrc[1].chomp else nil end end def is_smartos? - platform == 'smartos' + platform == "smartos" end collect_data do if is_smartos? joyent Mash.new @@ -56,17 +56,17 @@ # copy uuid joyent[:sm_uuid] = virtualization[:guest_uuid] # get zone id unless globalzone unless joyent[:sm_uuid] == "global" - joyent[:sm_id] = virtualization[:guest_id] + joyent[:sm_id] = virtualization[:guest_id] end # retrieve image name and pkgsrc collect_product_file.each do |line| case line when /^Image/ - sm_image = line.split(" ") + sm_image = line.split(" ") joyent[:sm_image_id] = sm_image[1] joyent[:sm_image_ver] = sm_image[2] when /^Base Image/ sm_baseimage = line.split(" ") joyent[:sm_baseimage_id] = sm_baseimage[2]