Feature #7996
Solaris 10/11 fact for physicalprocessorcount and ProcessorCount
| Status: | Closed | Start date: | 06/20/2011 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% |
||
| Category: | library | |||
| Target version: | 1.6.2 | |||
| Keywords: | Affected Facter version: | |||
| Branch: | https://github.com/adrienthebo/facter/tree/ticket/master/7996-add_solaris_processor_facts | |||
| Votes: | 0 |
Description
As soon as I figure out how to commit this :)
if Facter.value(:kernel) == "SunOS"
Facter.add("ProcessorCount") do
confine :operatingsystem => :solaris
confine :virtual => :physical
setcode do
Facter::Util::Resolution.exec("/usr/bin/kstat cpu_info | /usr/bin/grep core_id | /usr/bin/uniq | /usr/bin/wc -l")
end
end
end
if Facter.value(:kernel) == "SunOS"
Facter.add("physicalprocessorcount") do
confine :operatingsystem => :solaris
confine :virtual => :physical
setcode do
Facter::Util::Resolution.exec("/usr/sbin/psrinfo -p")
end
end
end
History
Updated by Merritt Krakowitzer 11 months ago
- Target version set to 1.6.0
Updated by Merritt Krakowitzer 11 months ago
- Status changed from Unreviewed to In Topic Branch Pending Review
- Branch set to https://github.com/mkrakowitzer/facter/tree/feature%2Fmaster%2F7996-adds-solaris-processor-facts
Updated by Michael Stahnke 11 months ago
- Target version changed from 1.6.0 to 1.6.x
Updated by James Turnbull 9 months ago
- Category set to library
Updated by Adrien Thebo 9 months ago
- Assignee changed from Merritt Krakowitzer to Adrien Thebo
- Branch changed from https://github.com/mkrakowitzer/facter/tree/feature%2Fmaster%2F7996-adds-solaris-processor-facts to https://github.com/adrienthebo/facter/tree/ticket/master/7996-add_solaris_processor_facts
Did a little cleanup on Merriott’s work and added unit tests.
Updated by Merritt Krakowitzer 8 months ago
Thanks for updating my code or should i say rewriting it :)
I think you should consider confining these facts to solaris 10/11
kstat and psrinfo are not available on Solaris 8/9 and many companies still have Solaris 8/9 that also use facter. I know we do.
Updated by Adrien Thebo 8 months ago
- Status changed from In Topic Branch Pending Review to Merged - Pending Release
Merged in commit:498d78fdc683f13c80c575a8732b461dc86508b6
In the case that these facts are run on a system that doesn’t have the necessary binaries, the fact will fail resolution and will return nil, so solaris 8 and 9 should be fine as-is. Thanks for the heads up on that point though.
Updated by Michael Stahnke 8 months ago
- Status changed from Merged - Pending Release to Closed
- Target version changed from 1.6.x to 1.6.2
Released as part of 1.6.2.