-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for OmniOS (OpenSolaris derivative) #2691
base: main
Are you sure you want to change the base?
Conversation
Can one of the admins verify this patch? |
lib/facter/facts/solaris/os/name.rb
Outdated
@@ -9,7 +9,8 @@ class Name | |||
|
|||
def call_the_resolver | |||
value = Facter::Resolvers::Uname.resolve(:kernelname) | |||
fact_value = value == 'SunOS' ? 'Solaris' : value | |||
version = Facter::Resolvers::Uname.resolve(:kernelversion) | |||
fact_value = value == 'SunOS' ? (version =~ /^omnios-/ ? 'OmniOS' : 'Solaris') : value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fact_value = value == 'SunOS' ? (version =~ /^omnios-/ ? 'OmniOS' : 'Solaris') : value | |
fact_value = case value | |
when 'SunOS' | |
'Solaris' | |
when /^omnios-/ | |
'OmniOS' | |
else | |
value | |
end |
Also could you add unit a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ptrrkssn could you take a look at ^ You may want to rebase too.
Co-authored-by: Josh Cooper <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also some tests are failing, could you take a look?
@@ -9,7 +9,15 @@ class Name | |||
|
|||
def call_the_resolver | |||
value = Facter::Resolvers::Uname.resolve(:kernelname) | |||
fact_value = value == 'SunOS' ? 'Solaris' : value | |||
version = Facter::Resolvers::Uname.resolve(:kernelversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is duplicate
version = Facter::Resolvers::Uname.resolve(:kernelversion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That update doesn't work - For OmniOS kernel name is SunOS so we need to look for kernelversion starting with omnios-
A couple of small fixes that enables "facter os" to give relevant info in the release hash instead of null, null, null (so other facts won't fail) and gives the OS name as "OmniOS" instead of "Solaris"..
Before:
facter os
{
architecture => "i86pc",
family => "Solaris",
hardware => "i86pc",
name => "Solaris",
release => {
full => null,
major => null,
minor => null
}
}
After:
facter os
{
architecture => "i86pc",
family => "Solaris",
hardware => "i86pc",
name => "OmniOS",
release => {
full => "11.r151048",
major => "11",
minor => "r151048"
}
}
cat /etc/release
OmniOS v11 r151048m
Copyright (c) 2012-2017 OmniTI Computer Consulting, Inc.
Copyright (c) 2017-2024 OmniOS Community Edition (OmniOSce) Association.
All rights reserved. Use is subject to licence terms.
uname -a
SunOS servername 5.11 omnios-r151048-4a265be889 i86pc i386 i86pc