class ForemanMaintain::Check

Attributes

associated_feature[RW]

Public Instance Methods

__run__(execution) click to toggle source

internal method called by executor

Calls superclass method
# File lib/foreman_maintain/check.rb, line 32
def __run__(execution)
  super
rescue Error::Fail => e
  fail!(e.message)
rescue Error::Warn => e
  warn!(e.message)
end
assert(condition, error_message, options = {}) click to toggle source

run condition and mark the check as failed when not passing

Options

  • +: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
# File lib/foreman_maintain/check.rb, line 17
def assert(condition, error_message, options = {})
  options = options.validate_options!(:next_steps)
  unless condition
    next_steps = Array(options.fetch(:next_steps, []))
    self.next_steps.concat(next_steps)
    raise Error::Fail, error_message
  end
end
run() click to toggle source

public method to be overriden

# File lib/foreman_maintain/check.rb, line 27
def run
  raise NotImplementedError
end