Issue #11082 has been updated by Ken Barber. Category set to library Status changed from Unreviewed to Accepted Target version set to 1.6.x
Hey thanks John - this looks quite good actually. If you can see your way to putting this into a github merge request that would be awesome, at least it would save us some time either way and you would be able to keep full credit on the patch. There are some contributor instructions here: <https://github.com/puppetlabs/facter/blob/master/CONTRIBUTING.md> Also usually for us to accept code submissions we require users to read and sign our CLA: <https://projects.puppetlabs.com/contributor_licenses/sign> Cheers :-). ---------------------------------------- Feature #11082: operatingsystemrelease for Solaris https://projects.puppetlabs.com/issues/11082 Author: John Warburton Status: Accepted Priority: Normal Assignee: Category: library Target version: 1.6.x Keywords: Branch: Affected Facter version: We need to know what release of Solaris installed. We have code (below) which parses /etc/release, which maybe others would like to see in future versions of facter rather than returning kernelversion Code is clunky, as my ruby is pretty basic, but should go into lib/facter/operatingsystemrelease.rb. Ideally the regexp should not need the extra "ustring" search, but I haven't worked out how to cater for when the "_u" is not present - which is why I'm not prepared to submit a patch The values returned work correctly with the versioncmp function releasefile = "/etc/release" File::open(releasefile, "r") do |f| line = f.readline.chomp line =~ /s(\d+)[s|x]*.* [SPARC|X86]/ relstring = $1 # sometimes the _u is not there on the initial release line =~ /s\d+[s|x]*_u(\d+).* [SPARC|X86]/ ustring = $1 if (ustring.nil?) operatingsystemrelease = relstring else operatingsystemrelease = relstring + "_u#{ustring}" end Note that this regexp has been tested against all /etc/release entries from Solaris 8 to Solaris 10 U10 (SPARC & x86) per Support Document [How to Determine the Release and Default Kernel Version in the Solaris Operating System [ID 1002239.1]](https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=HOWTO&id=1002239.1) (you need an Oracle support account to view this file). I do not have a Solaris 11 server to validate Solaris 11 Here are my test results: Solaris 8 s28_38shwp2 SPARC ==> 28 Solaris 8 6/00 s28s_u1wos_08 SPARC ==> 28_u1 Solaris 8 10/00 s28s_u2wos_11b SPARC ==> 28_u2 Solaris 8 1/01 s28s_u3wos_08 SPARC ==> 28_u3 Solaris 8 4/01 s28s_u4wos_08 SPARC ==> 28_u4 Solaris 8 7/01 s28s_u5wos_08 SPARC ==> 28_u5 Solaris 8 10/01 s28s_u6wos_08a SPARC ==> 28_u6 Solaris 8 2/02 s28s_u7wos_08a SPARC ==> 28_u7 Solaris 8 HW 12/02 s28s_hw1wos_06a SPARC ==> 28 Solaris 8 HW 5/03 s28s_hw2wos_06a SPARC ==> 28 Solaris 8 HW 7/03 s28s_hw3wos_05a SPARC ==> 28 Solaris 8 2/04 s28s_hw4wos_05a SPARC ==> 28 Solaris 9 s9_58shwpl3 SPARC ==> 9 Solaris 9 9/02 s9s_u1wos_08b SPARC ==> 9_u1 Solaris 9 12/02 s9s_u2wos_10 SPARC ==> 9_u2 Solaris 9 4/03 s9s_u3wos_08 SPARC ==> 9_u3 Solaris 9 8/03 s9s_u4wos_08a SPARC ==> 9_u4 Solaris 9 12/03 s9s_u5wos_08b SPARC ==> 9_u5 Solaris 9 4/04 s9s_u6wos_08a SPARC ==> 9_u6 Solaris 9 9/04 s9s_u7wos_09 SPARC ==> 9_u7 Solaris 9 9/05 s9s_u8wos_05 SPARC ==> 9_u8 Solaris 9 9/05 HW s9s_u9wos_06b SPARC ==> 9_u9 Solaris 10 3/05 s10_74L2a SPARC ==> 10 Solaris 10 3/05 HW1 s10s_wos_74L2a SPARC ==> 10 Solaris 10 3/05 HW2 s10s_hw2wos_05 SPARC ==> 10 Solaris 10 1/06 s10s_u1wos_19a SPARC ==> 10_u1 Solaris 10 6/06 s10s_u2wos_09a SPARC ==> 10_u2 Solaris 10 11/06 s10s_u3wos_10 SPARC ==> 10_u3 Solaris 10 8/07 s10s_u4wos_12b SPARC ==> 10_u4 Solaris 10 5/08 s10s_u5wos_10 SPARC ==> 10_u5 Solaris 10 10/08 s10s_u6wos_07b SPARC ==> 10_u6 Solaris 10 5/09 s10s_u7wos_08 SPARC ==> 10_u7 Solaris 10 10/09 s10s_u8wos_08a SPARC ==> 10_u8 Oracle Solaris 10 9/10 s10s_u9wos_14a SPARC ==> 10_u9 Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC ==> 10_u10 Solaris 10 3/05 HW1 s10x_wos_74L2a X86 ==> 10 Solaris 10 1/06 s10x_u1wos_19a X86 ==> 10_u1 Solaris 10 6/06 s10x_u2wos_09a X86 ==> 10_u2 Solaris 10 11/06 s10x_u3wos_10 X86 ==> 10_u3 Solaris 10 8/07 s10x_u4wos_12b X86 ==> 10_u4 Solaris 10 5/08 s10x_u5wos_10 X86 ==> 10_u5 Solaris 10 10/08 s10x_u6wos_07b X86 ==> 10_u6 Solaris 10 5/09 s10x_u7wos_08 X86 ==> 10_u7 Solaris 10 10/09 s10x_u8wos_08a X86 ==> 10_u8 Oracle Solaris 10 9/10 s10x_u9wos_14a X86 ==> 10_u9 Oracle Solaris 10 8/11 s10x_u10wos_17b X86 ==> 10_u10 -- 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://projects.puppetlabs.com/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.
