lib/puppet_litmus/rake_helper.rb
# Parse out errors messages in result set returned by Bolt command.
#
# @param result_set [Array] result set returned by Bolt command.
# @return [Hash] Errors grouped by target.
Parse out errors messages in result set returned by Bolt command.
Parse out errors messages in result set returned by Bolt command .
def check_bolt_errors(result_set)
    errors = {}
    result_set.each do |target_result|
      status = target_result['status']
      next if status != 'failure'
      target = target_result['target']
      errors[target] = target_result['value']
    end
    errors
  end
def check_bolt_errors ( result_set ) errors = { } result_set . each do | target_result | status = target_result [ 'status' ] next if status != 'failure' target = target_result [ 'target' ] errors [ target ] = target_result [ 'value' ] end errors end
Parse out errors messages in result set returned by Bolt command.
Parse out errors messages in result set returned by Bolt command .
# iterate through each error # jump to the next one when there is not fail # get some info from error
Errors grouped by target.
Errors grouped by target .
Hash
result_set
result set returned by Bolt command.
result set returned by Bolt command .