class MotherBrain::GroupBootstrapError

Attributes

groups[R]

@return [Array<String>]

host_errors[R]

@return [Hash]

Public Class Methods

new(host_errors) click to toggle source

@param [Hash] host_errors

"cloud-3.riotgames.com" => {
  groups: ["database_slave::default"],
  result: {
    status: :ok
    message: ""
    bootstrap_type: :partial
  }
}
# File lib/mb/errors.rb, line 522
def initialize(host_errors)
  @groups      = Set.new
  @host_errors = Hash.new

  host_errors.each do |host, host_info|
    @host_errors[host] = host_info
    host_info[:groups].each { |group| @groups.add(group) }
  end
end

Public Instance Methods

message() click to toggle source
# File lib/mb/errors.rb, line 532
def message
  err = ""
  groups.each do |group|
    err << "failure bootstrapping group #{group}\n"
    host_errors.each do |host, host_info|
      if host_info[:groups].include?(group)
        err << "  * #{host} #{host_info[:result]}\n"
      end
    end
    err << "\n"
  end
  err
end