Skip to content

Commit

Permalink
Don't reboot when :reboot_allowed is set and only one kernel is insta…
Browse files Browse the repository at this point in the history
  • Loading branch information
workeitel committed Jan 21, 2015
1 parent e19ed72 commit 4dc1184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dependencies/recipes/update.rb
Expand Up @@ -36,8 +36,8 @@
execute "/sbin/shutdown -r +2 &" do
only_if do
installed_kernels = OpsWorks::ShellOut.shellout("rpm -q --last kernel")
latest_installed_kernel = installed_kernels.gsub(/^kernel-(\S+).*/, '\1').strip!.lines.first.strip!
current_used_kernel = OpsWorks::ShellOut.shellout("uname -r").strip!
latest_installed_kernel = installed_kernels.gsub(/^kernel-(\S+).*/, '\1').lines.first.strip
current_used_kernel = OpsWorks::ShellOut.shellout("uname -r").strip
reboot_required = latest_installed_kernel != current_used_kernel
if node[:dependencies][:allow_reboot]
reboot_required
Expand Down

0 comments on commit 4dc1184

Please sign in to comment.