Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created June 11, 2015 18:55
Show Gist options
  • Save anonymous/a2487b709d1421d5dda7 to your computer and use it in GitHub Desktop.
Save anonymous/a2487b709d1421d5dda7 to your computer and use it in GitHub Desktop.
unless node['normal']['chef_client']['tomcat_restart'].nil? ## Exception here
ruby_block "Check if Tomcat need to restart" do
block do
if node['normal']['chef_client']['tomcat_restart'] != 0
node.default['normal']['chef_client']['tomcat_restart'] = node['normal']['chef_client']['tomcat_restart'] - 1
resources(:service => "tomcat6").run_action(:restart)
end
end
end
end
## Line 1: NoMethodError-------------undefined method `[]' for nil:NilClassCookbook Trace:--------------- C:/chef/cache/cookbooks/...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment