Method: Chef::DataBag#save

Defined in:
lib/chef/data_bag.rb

#saveObject

Save the Data Bag via RESTful API



149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/chef/data_bag.rb', line 149

def save
  begin
    if Chef::Config[:why_run]
      Chef::Log.warn("In why-run mode, so NOT performing data bag save.")
    else
      create
    end
  rescue Net::HTTPClientException => e
    raise e unless e.response.code == "409"
  end
  self
end