Parent

Included Modules

Class/Module Index [+]

Quicksearch

Ironfan::Script

Public Instance Methods

aggregates?() click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 92
def aggregates?
  true
end
aggregates_on_noop?() click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 96
def aggregates_on_noop?
  false
end
perform_execution(target) click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 80
def perform_execution(target)
  target.send(sub_command)
end
prepares?() click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 84
def prepares?
  true
end
prepares_on_noop?() click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 88
def prepares_on_noop?
  false
end
run() click to toggle source
# File lib/chef/knife/ironfan_script.rb, line 39
def run
  load_ironfan

  die(banner) if @name_args.empty?
  configure_dry_run

  target = get_relevant_slice(* @name_args)

  if prepares? and (prepares_on_noop? or not target.empty?)
    ui.info "Preparing shared resources:"
    all_computers(*@name_args).prepare
  end

  unless target.empty?
    ui.info(["\n",
             ui.color("Running #{sub_command}", :cyan),
             " on #{target.joined_names}..."].join())
    unless config[:yes]
      ui.info("")
      confirm_execution(target)
    end
    #
    perform_execution(target)
  end

  if healthy? and aggregates? and (aggregates_on_noop? or not target.empty?)
    ui.info "Applying aggregations:"
    all_computers(*@name_args).aggregate
  end

  if target.empty?
    ui.warn("No computers to #{sub_command}")
  else
    ui.info("")
    ui.info "Finished! Current state:"
    display(target)
  end
  #
  exit_if_unhealthy!
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.