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.
505
506
507
508
509
510
511
512
513
|
# File 'lib/mb/errors.rb', line 505
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>
491
492
493
|
# File 'lib/mb/errors.rb', line 491
def groups
@groups
end
|
#host_errors ⇒ Hash
493
494
495
|
# File 'lib/mb/errors.rb', line 493
def host_errors
@host_errors
end
|
Instance Method Details
#message ⇒ Object
515
516
517
518
519
520
521
522
523
524
525
526
527
|
# File 'lib/mb/errors.rb', line 515
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
|