Skip to content

Commit

Permalink
Merge pull request #104 from bloombergindustry/bls-cmdline
Browse files Browse the repository at this point in the history
fix: limit scope of update-bls-cmdline to RHEL9
  • Loading branch information
vchepkov authored Aug 21, 2024
2 parents 2f7a6d7 + 3911c1b commit f7093dc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ def self.mkconfig_path
#
# @return (String) The commandline
def self.mkconfig_cmdline
needs_bls_cmdline = lambda do
os = Facter.value(:os)
return false unless os.is_a?(Hash)

return false unless os['family'] == 'RedHat'
return false if os['release']['major'].to_i < 9
return false if os['release']['major'].to_i == 9 && os['release']['minor'].to_i < 3

true
end
os = Facter.value(:os)
# BLS cmdline option is only needed on RHEL 9.3+
# Fedora and Amazon Linux lack support and are excluded
# since they don't have a release with major version 9
needs_bls_cmdline = os.is_a?(Hash) && os['family'] == 'RedHat' &&
os['release']['major'].to_i == 9 && os['release']['minor'].to_i >= 3

cmdline = [mkconfig_path]
cmdline << '--update-bls-cmdline' if needs_bls_cmdline.call
cmdline << '--update-bls-cmdline' if needs_bls_cmdline
cmdline
end

Expand Down

0 comments on commit f7093dc

Please sign in to comment.