Skip to content

Commit

Permalink
Drop stderr from mkconfig output when updating grub (#84)
Browse files Browse the repository at this point in the history
* Drop stderr from mkconfig output

* Fix references to mkconfig_path class method
  • Loading branch information
glangloi authored Aug 17, 2023
1 parent f59a752 commit 3570c76
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
7 changes: 6 additions & 1 deletion lib/puppet/provider/grub_config/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ def self.mkconfig_path
end

confine feature: :augeas
commands mkconfig: mkconfig_path

confine exists: mkconfig_path, for_binary: true

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

defaultfor osfamily: :RedHat

Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/provider/grub_menuentry/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,12 @@ def self.prefetch(resources)

#### End Class Methods

commands mkconfig: mkconfig_path
confine exists: mkconfig_path, for_binary: true

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

commands grubby: 'grubby'
commands grub_set_default: 'grub2-set-default'

Expand Down
6 changes: 5 additions & 1 deletion lib/puppet/provider/grub_user/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ def self.mkconfig_path
which('grub2-mkconfig') or which('grub-mkconfig') or '/usr/sbin/grub-mkconfig'
end

commands mkconfig: mkconfig_path
confine exists: mkconfig_path, for_binary: true

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

confine exists: '/etc/grub.d'

Expand Down
7 changes: 6 additions & 1 deletion lib/puppet/provider/kernel_parameter/grub2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ def self.mkconfig_path

confine feature: :augeas
defaultfor augeasprovider_grub_version: 2
commands mkconfig: mkconfig_path

confine exists: mkconfig_path, for_binary: true

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

# when both grub* providers match, prefer GRUB 2
def self.specificity
Expand Down

0 comments on commit 3570c76

Please sign in to comment.