components/ruby/facter/patches/facter-02-FACT-656.patch
author Kristina Tripp <Kristina.Tripp@oracle.com>
Fri, 17 Oct 2014 09:32:29 -0700
branchs11-update
changeset 3401 bd976a0fa74e
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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3401
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     1
Patch for FACT-656 facter generates error on Solaris kernel zone due to prtdiag
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     2
Upstream bug: https://tickets.puppetlabs.com/browse/FACT-656
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     3
--- facter-2.1.0/lib/facter/virtual.rb.orig	2014-08-18 10:37:43.330858038 -0600
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     4
+++ facter-2.1.0/lib/facter/virtual.rb	2014-08-18 10:38:02.723874811 -0600
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     5
@@ -67,7 +67,7 @@
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     6
   setcode do
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     7
     next "zone" if Facter::Util::Virtual.zone?
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     8
 
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
     9
-    output = Facter::Core::Execution.exec('prtdiag')
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    10
+    output = Facter::Core::Execution.exec('/usr/sbin/prtdiag 2>/dev/null')
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    11
     if output
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    12
       lines = output.split("\n")
bd976a0fa74e 18354422 facter cannot parse the output of GNU uptime
Kristina Tripp <Kristina.Tripp@oracle.com>
parents:
diff changeset
    13
       next "parallels"  if lines.any? {|l| l =~ /Parallels/ }