theforeman/foreman_maintain

View on GitHub
definitions/procedures/packages/check_for_reboot.rb

Summary

Maintainability
A
0 mins
Test Coverage
module Procedures::Packages
  class CheckForReboot < ForemanMaintain::Procedure
    metadata do
      description 'Check if system needs reboot'
    end

    def run
      status, output = package_manager.reboot_required?
      if status == 1
        set_info_warn(output)
      else
        set_status(:success, output)
      end
    end
  end
end