mirror of
https://github.com/inspec/inspec
synced 2024-12-03 18:09:32 +00:00
Merge pull request #5306 from james-stocks/js/grub2
grub_conf - handle no menuentry config
This commit is contained in:
commit
673e0415dc
1 changed files with 2 additions and 1 deletions
|
@ -29,7 +29,7 @@ module Inspec::Resources
|
||||||
@content = read_file(@conf_path)
|
@content = read_file(@conf_path)
|
||||||
@kernel = kernel || "default"
|
@kernel = kernel || "default"
|
||||||
rescue UnknownGrubConfig
|
rescue UnknownGrubConfig
|
||||||
skip_resource "The `grub_config` resource is not supported on your OS yet."
|
skip_resource "The `grub_conf` resource is not yet supported on the target OS #{inspec.os[:name]}."
|
||||||
end
|
end
|
||||||
|
|
||||||
def config_for_platform(path)
|
def config_for_platform(path)
|
||||||
|
@ -77,6 +77,7 @@ module Inspec::Resources
|
||||||
|
|
||||||
def grub2_parse_kernel_lines(content, conf)
|
def grub2_parse_kernel_lines(content, conf)
|
||||||
menu_entries = extract_menu_entries(content)
|
menu_entries = extract_menu_entries(content)
|
||||||
|
return {} if menu_entries.empty?
|
||||||
|
|
||||||
if @kernel == "default"
|
if @kernel == "default"
|
||||||
default_menu_entry(menu_entries, conf["GRUB_DEFAULT"])
|
default_menu_entry(menu_entries, conf["GRUB_DEFAULT"])
|
||||||
|
|
Loading…
Reference in a new issue