Issue #2104 has been reported by glaw.

----------------------------------------
Bug #2104: Facter on OpenSolaris
http://projects.reductivelabs.com/issues/2104

Author: glaw
Status: Unreviewed
Priority: Normal
Assigned to: 
Category: 
Target version: 
Complexity: Unknown
Keywords: facter solaris opensolaris release


$ /opt/csw/bin/ruby --version
ruby 1.8.7 (2008-06-20 patchlevel 22) [i386-solaris2.8]

here's the backtrace with stock facter:

$ PATH=/opt/csw/bin:$PATH facter
/opt/csw/lib/ruby/site_ruby/1.8/facter/operatingsystemrelease.rb:79: private 
method `chomp' called for nil:NilClass (NoMethodError)
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:117:in 
`call'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:117:in 
`value'
       from /opt/csw/lib/ruby/1.8/timeout.rb:53:in `timeout'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/resolution.rb:115:in 
`value'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:75:in `value'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/loader.rb:72:in `inject'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:71:in `each'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:71:in `inject'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:71:in `value'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:117:in 
`searching'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/fact.rb:67:in `value'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/collection.rb:104:in 
`to_hash'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/loader.rb:72:in `inject'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/collection.rb:103:in 
`each'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/collection.rb:103:in 
`inject'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter/util/collection.rb:103:in 
`to_hash'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter.rb:92:in `send'
       from /opt/csw/lib/ruby/site_ruby/1.8/facter.rb:92:in `to_hash'
       from /opt/csw/bin/facter:121


here's what /etc/release looks like on OpenSolaris 2008.11:

$ cat /etc/release
                      OpenSolaris 2008.11 snv_101b_rc2 X86
          Copyright 2008 Sun Microsystems, Inc.  All Rights Reserved.
                       Use is subject to license terms.
                          Assembled 19 November 2008

here's the patch to facter:

--- /opt/csw/lib/ruby/site_ruby/1.8/facter/operatingsystemrelease.rb.old        
2009-03-24 14:08:27.461585828 +0100
+++ /opt/csw/lib/ruby/site_ruby/1.8/facter/operatingsystemrelease.rb    
2009-03-24 14:06:41.855259343 +0100
@@ -76,7 +76,9 @@
 Facter.add(:operatingsystemrelease) do
    confine :operatingsystem => %w{Solaris}
    setcode do
-        full_release = File.readlines("/etc/release").to_s.match(/Solaris \w+ 
[\w\/]+ ([^_]+_[^_]+)/).to_a.last.chomp("wos")
+        release_text = File.readlines("/etc/release").to_s
+        full_release = release_text.match(/OpenSolaris (\d+\.\d+)/) || 
release_text.match(/Solaris \w+ [\w\/]+ ([^_]+_[^_]+)/)
+        full_release = full_release.to_a.last.chomp("wos")
        if full_release =~ /^s(\d+)\w(_\w\d)+/
            $1 + $2
        else

I guess it can be debated if $operatingsystem should be "solaris" or
"opensolaris".  with the above patch, OpenSolaris 2008.11 will be
reported as "solaris 2008.11".  I think that's the more useful setting,
you can't do numeric comparisons on Solaris versions anyway.




----------------------------------------
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to