Exception: MotherBrain::GroupBootstrapError
Constant Summary
Constants inherited
from MBError
MBError::DEFAULT_EXIT_CODE
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from MBError
#error_code, error_code, exit_code, #exit_code, #to_hash, #to_json, #to_s
Constructor Details
Returns a new instance of GroupBootstrapError.
522
523
524
525
526
527
528
529
530
|
# 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
|
Instance Attribute Details
#groups ⇒ Array<String>
508
509
510
|
# File 'lib/mb/errors.rb', line 508
def groups
@groups
end
|
#host_errors ⇒ Hash
510
511
512
|
# File 'lib/mb/errors.rb', line 510
def host_errors
@host_errors
end
|
Instance Method Details
#message ⇒ Object
532
533
534
535
536
537
538
539
540
541
542
543
544
|
# 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
|