components/ruby/facter/patches/facter-04-FACT-660.patch
author Kristina Tripp <Kristina.Tripp@oracle.com>
Mon, 20 Oct 2014 13:13:15 -0700
branchs11u2-sru
changeset 3407 e5c7eb70e0b8
child 5860 afd31ba91ee9
permissions -rw-r--r--
18354422 facter cannot parse the output of GNU uptime 18960283 problem in UTILITY/PUPPET 18960296 Update Facter to 2.1.0 19357281 facter --help doesn't work 19402424 puppet error when no swap devices configured 19646677 facter-19 package not installed if ruby-19 not installed 19596952 Update facter 2.1.0 license 17797881 Add facter support for ldoms

Patch for FACT-660 Facter on Solaris 11.2+ should report if zones are supported
Upstream bug: https://tickets.puppetlabs.com/browse/FACT-660
--- facter-2.1.0/lib/facter/util/solaris_zones.rb.orig	2014-08-19 13:49:14.721574641 -0600
+++ facter-2.1.0/lib/facter/util/solaris_zones.rb	2014-08-19 13:50:03.475818042 -0600
@@ -156,3 +156,29 @@
   end
 end
 end
+
+Facter.add("kernel_zone") do
+  confine :operatingsystem => :Solaris
+  setcode do
+      virtinfo = %x{/sbin/virtinfo list -H -o class kernel-zone 2>/dev/null}
+      case virtinfo.chomp!
+      when "supported", "current", "parent"
+          virtinfo
+      else
+          "unsupported"
+      end
+  end
+end
+
+Facter.add("non_global_zone") do
+  confine :operatingsystem => :Solaris
+  setcode do
+      virtinfo = %x{/sbin/virtinfo list -H -o class non-global-zone 2>/dev/null}
+      case virtinfo.chomp!
+      when "supported", "current"
+          virtinfo
+      else
+          "unsupported"
+      end
+  end
+end