Merge "fix NoMethodError in ShellOut run_command"

This commit is contained in:
Jenkins 2014-01-08 17:33:58 +00:00 committed by Gerrit Code Review
commit 481007ad84
1 changed files with 5 additions and 4 deletions

View File

@ -59,11 +59,12 @@ end
def set_grub2_default_kernel(flavor='default')
boot_entry = "'openSUSE GNU/Linux, with Xen hypervisor'"
if Mixlib::ShellOut.new("grub2-set-default #{boot_entry}").error
::Chef::Application.fatal!(
"Unable to change grub2 default to #{boot_entry}")
else
begin
Mixlib::ShellOut.new("grub2-set-default #{boot_entry}").run_command.error!
::Chef::Log.info("Changed grub2 default to #{boot_entry}")
rescue Mixlib::ShellOut::ShellCommandFailed => e
::Chef::Application.fatal!(
"Unable to change grub2 default to #{boot_entry}\n#{e.message}")
end
end