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 EL8 #39
Conversation
@@ -8,12 +8,16 @@ | |||
if $sensuclassic::repo_source { | |||
$url = $sensuclassic::repo_source | |||
} else { | |||
$major = $facts.dig('os', 'release', 'major') |
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.
why dig? why not just address the facts by name?
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.
Because it would require more complete unit tests because if you do $facts['os']['family']
and $facts['os']
is not defined, you get errors. Dig is much safer when traversing deep hash in case facts are missing.
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 ever since Puppet 5 dig is the better way to walk a hash, just safer and less verbose than checking each intermediate key exists. Might have been around since Puppet 4, but I know it's built-in to Puppet 5.
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.
These facts always exist and if they didn't something would be terribly wrong. This makes sense to me if we are digging into data structures that are more dynamic. Please just access the facts as that makes it easier to read.
I tried using without Looks like to remove the use of
|
Released in v3.7.0 |
Pull Request Checklist
Description
Add support for EL8 by installing EL7 packages.