# File lib/chef/node.rb, line 628 def save # Try PUT. If the node doesn't yet exist, PUT will return 404, # so then POST to create. begin if Chef::Config[:why_run] Chef::Log.warn("In whyrun mode, so NOT performing node save.") else chef_server_rest.put_rest("nodes/#{name}", self) end rescue Net::HTTPServerException => e raise e unless e.response.code == "404" chef_server_rest.post_rest("nodes", self) end self end