Sha256: 71abdfea30ea354b496cfab580178513fd2e4392663b811abe4757ec78607365

Contents?: true

Size: 511 Bytes

Versions: 67

Compression:

Stored size: 511 Bytes

Contents

# Handler to kill the run if any resource is updated
class UpdatedResources < ::Chef::Handler
  def report
    if updated_resources.size > 0
      puts "First chef run should have reached a converged state."
      puts "Resources updated in a second chef-client run:"
      updated_resources.each do |r|
        puts "- #{r}"
      end
      # exit 203 # chef handler catch Exception instead of StandardException
      Process.kill("KILL", Process.pid)
    end
  end
end
report_handlers << UpdatedResources.new

Version data entries

67 entries across 67 versions & 2 rubygems

Version Path
test-kitchen-3.7.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.6.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.5.1 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.5.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.4.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.3.2 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.3.1 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.3.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.2.2 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.2.1 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.2.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.1.1 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.1.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-rsync-3.0.0.pre.3 support/chef-client-fail-if-update-handler.rb
test-kitchen-rsync-3.0.0.pre.2 support/chef-client-fail-if-update-handler.rb
test-kitchen-rsync-3.0.0.pre.1 support/chef-client-fail-if-update-handler.rb
test-kitchen-3.0.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-2.12.0 support/chef-client-fail-if-update-handler.rb
test-kitchen-2.11.2 support/chef-client-fail-if-update-handler.rb
test-kitchen-2.11.1 support/chef-client-fail-if-update-handler.rb