Sha256: 2b372309646fbad2e2d5676d1909e320e4884755e7771b50982e7599773bddf2

Contents?: true

Size: 812 Bytes

Versions: 73

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

# Returns a ResultSet with canary/skipped-node errors for each Target provided.
#
# This function takes a single parameter:
# * List of nodes (Array[Variant[Target,String]])
#
# Returns a ResultSet.
Puppet::Functions.create_function(:'canary::skip') do
  dispatch :skip_result do
    param 'Array[Variant[Target,String]]', :nodes
  end

  def skip_result(nodes)
    results = nodes.map do |node|
      node = Bolt::Target.new(node) unless node.is_a? Bolt::Target
      Bolt::Result.new(node, value: { '_error' => {
                         'msg' => "Skipped #{node.name} because of a previous failure",
                         'kind' => 'canary/skipped-node',
                         'details' => {}
                       } })
    end
    Bolt::ResultSet.new(results)
  end
end

Version data entries

73 entries across 73 versions & 1 rubygems

Version Path
bolt-0.21.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.21.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.7 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.6 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.5 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.3 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.2 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.20.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.19.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.19.0 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.18.2 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.18.1 modules/canary/lib/puppet/functions/canary/skip.rb
bolt-0.18.0 modules/canary/lib/puppet/functions/canary/skip.rb