Add support for OmniOS (OpenSolaris derivative)#2691
Open
ptrrkssn wants to merge 2 commits into
Open
Conversation
Collaborator
|
Can one of the admins verify this patch? |
joshcooper
reviewed
Apr 12, 2024
| 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 |
Contributor
There was a problem hiding this comment.
Suggested change
| 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?
Contributor
There was a problem hiding this comment.
@ptrrkssn could you take a look at ^ You may want to rebase too.
Co-authored-by: Josh Cooper <737664+joshcooper@users.noreply.github.com>
joshcooper
requested changes
Aug 2, 2024
joshcooper
left a comment
Contributor
There was a problem hiding this comment.
Also some tests are failing, could you take a look?
| def call_the_resolver | ||
| value = Facter::Resolvers::Uname.resolve(:kernelname) | ||
| fact_value = value == 'SunOS' ? 'Solaris' : value | ||
| version = Facter::Resolvers::Uname.resolve(:kernelversion) |
Contributor
There was a problem hiding this comment.
This line is duplicate
Suggested change
| version = Facter::Resolvers::Uname.resolve(:kernelversion) |
Author
There was a problem hiding this comment.
No it's not a duplicate - :kernelversion and :kernelname is not the same
ptrrkssn
commented
Aug 3, 2024
ptrrkssn
left a comment
Author
There was a problem hiding this comment.
That update doesn't work - For OmniOS kernel name is SunOS so we need to look for kernelversion starting with omnios-
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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