summaryrefslogtreecommitdiff
path: root/lib/chef/data_bag.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/data_bag.rb')
-rw-r--r--lib/chef/data_bag.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/chef/data_bag.rb b/lib/chef/data_bag.rb
index dcc01ec743..5994e6f8d1 100644
--- a/lib/chef/data_bag.rb
+++ b/lib/chef/data_bag.rb
@@ -129,11 +129,10 @@ class Chef
if Chef::Config[:why_run]
Chef::Log.warn("In whyrun mode, so NOT performing data bag save.")
else
- chef_server_rest.put_rest("data/#{@name}", self)
+ create
end
rescue Net::HTTPServerException => e
- raise e unless e.response.code == "404"
- chef_server_rest.post_rest("data", self)
+ raise e unless e.response.code == "409"
end
self
end