internal method called by executor
# File lib/foreman_maintain/check.rb, line 39 def __run__(execution) super rescue Error::Fail => e set_fail(e.message) rescue Error::Warn => e set_warn(e.message) end
run condition and mark the check as failed when not passing
+:next_steps* - one or more procedures that can be followed to address
the failure, will be offered to the user when running in interactive mode
+:warn* - issue warning instead of failure: this is less strict check,
that could be considered as non-critical for continuing with the scenario
# File lib/foreman_maintain/check.rb, line 20 def assert(condition, error_message, options = {}) options = options.validate_options!(:next_steps, :warn) unless condition next_steps = Array(options.fetch(:next_steps, [])) self.next_steps.concat(next_steps) if options[:warn] warn!(error_message) else fail!(error_message) end end end
public method to be overriden
# File lib/foreman_maintain/check.rb, line 34 def run raise NotImplementedError end