Skip to content

Commit

Permalink
Update BLS kernel options on EL >= 9.3
Browse files Browse the repository at this point in the history
Fixes #95
  • Loading branch information
silug committed Jul 9, 2024
1 parent a12d428 commit 6f11d07
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,21 @@ def self.mkconfig_path

confine exists: mkconfig_path, for_binary: true

# Add BLS specific option to mkconfig command if needed
#
# @return (String) The commandline
def self.mkconfig_cmdline
cmdline = [self.mkconfig_path]

Check failure on line 38 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/RedundantSelf: Redundant `self` detected. (https://rubystyle.guide#no-self-unless-required)
if ((Facter.value(:os) && Facter.value(:os)['family']) == 'RedHat')

Check failure on line 39 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/ParenthesesAroundCondition: Don't use parentheses around the condition of an `if`. (https://rubystyle.guide#no-parens-around-condition)
if ((Facter.value(:os)['release']['major'].to_i == 9) && (Facter.value(:os)['release']['minor'].to_i >= 3)) || (Facter.value(:os)['release']['major'].to_i > 9)

Check failure on line 40 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/IfUnlessModifier: Favor modifier `if` usage when having a single-line body. Another good alternative is the usage of control flow `&&`/`||`. (https://rubystyle.guide#if-as-a-modifier)

Check failure on line 40 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/SoleNestedConditional: Consider merging nested conditions into outer `if` conditions.
cmdline = cmdline.append("--update-bls-cmdline")

Check failure on line 41 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/RedundantSelfAssignment: Redundant self assignment detected. Method `append` modifies its receiver in place.

Check failure on line 41 in lib/puppet/provider/kernel_parameter/grub2.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
end
end
cmdline
end

def mkconfig
execute(self.class.mkconfig_path, { failonfail: true, combine: false })
execute(self.class.mkconfig_cmdline, { failonfail: true, combine: false })
end

# when both grub* providers match, prefer GRUB 2
Expand Down

0 comments on commit 6f11d07

Please sign in to comment.