Class: ForemanMaintain::Scenario::FilteredScenario

Inherits:
ForemanMaintain::Scenario show all
Defined in:
lib/foreman_maintain/scenario.rb

Instance Attribute Summary collapse

Attributes inherited from ForemanMaintain::Scenario

#steps

Instance Method Summary collapse

Methods inherited from ForemanMaintain::Scenario

#add_step, #add_steps, #before_scenarios, #compose, #executed_steps, #failed?, #filter_whitelisted, inspect, #inspect, #load_step_states, new_from_hash, #passed?, #preparation_steps, #steps_with_error, #steps_with_warning, #to_hash

Methods included from Concerns::Finders

#check, #detector, #feature, #find_all_scenarios, #find_checks, #find_procedures, #find_scenarios, #procedure

Methods included from Concerns::ScenarioMetadata

included, #run_strategy

Methods included from Concerns::SystemHelpers

#check_min_version, #clean_all_packages, #downstream_installation?, #execute, #execute!, #execute?, #file_exists?, #find_package, #hostname, included, #package_version, #packages_action, #parse_csv, #parse_json, #rpm_version, #server?, #shellescape, #smart_proxy?, #version

Methods included from Concerns::Logger

#logger

Constructor Details

#initialize(filter, definition_kinds = [:check]) ⇒ FilteredScenario

Returns a new instance of FilteredScenario.



19
20
21
22
23
24
25
26
27
# File 'lib/foreman_maintain/scenario.rb', line 19

def initialize(filter, definition_kinds = [:check])
  @filter_tags = filter[:tags]
  @filter_label = filter[:label]
  @definition_kinds = definition_kinds
  @steps = []
  @steps += checks(filter) if definition_kinds.include?(:check)
  @steps += procedures(filter) if definition_kinds.include?(:procedure)
  @steps = DependencyGraph.sort(@steps)
end

Instance Attribute Details

#filter_labelObject (readonly)

Returns the value of attribute filter_label.



17
18
19
# File 'lib/foreman_maintain/scenario.rb', line 17

def filter_label
  @filter_label
end

#filter_tagsObject (readonly)

Returns the value of attribute filter_tags.



17
18
19
# File 'lib/foreman_maintain/scenario.rb', line 17

def filter_tags
  @filter_tags
end

Instance Method Details

#runtime_messageObject



29
30
31
32
33
34
35
# File 'lib/foreman_maintain/scenario.rb', line 29

def runtime_message
  if @filter_label
    "#{kind_list} with label [#{dashize(@filter_label)}]"
  else
    "#{kinds_list} with tags #{tag_string(@filter_tags)}"
  end
end