Parent

Class/Module Index [+]

Quicksearch

Ironfan::Broker

Public Instance Methods

discover!(cluster) click to toggle source

Take in a Dsl::Cluster; return Computers populated with all discovered

resources that correlate; computers corresponding to partial or
unrecognizable resources are labeled as bogus.
# File lib/ironfan/broker.rb, line 14
def discover!(cluster)

  # Get fully resolved servers, and build Computers using them
  computers = Computers.new(:cluster => cluster)
  #
  providers = computers.map{|c| c.providers.values }.flatten.uniq
  Ironfan.parallel(providers) do |provider|
    Ironfan.step cluster.name, "Loading #{provider.handle}", :cyan
    provider.load cluster
  end
  #
  Ironfan.step cluster.name, "Reconciling DSL and provider information", :cyan

  computers.correlate
  computers.validate
  #
  computers
end
display(computers,style) click to toggle source
# File lib/ironfan/broker.rb, line 33
def display(computers,style)
  defined_data = computers.map {|m| m.to_display(style) }
  if defined_data.empty?
    ui.info "Nothing to report"
  else
    headings = defined_data.map{|r| r.keys}.flatten.uniq
    Formatador.display_compact_table(defined_data, headings.to_a)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.