diff options
Diffstat (limited to 'chef-server-webui/app/controllers/nodes.rb')
-rw-r--r-- | chef-server-webui/app/controllers/nodes.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/chef-server-webui/app/controllers/nodes.rb b/chef-server-webui/app/controllers/nodes.rb index f2b9cbb30e..f28ccac668 100644 --- a/chef-server-webui/app/controllers/nodes.rb +++ b/chef-server-webui/app/controllers/nodes.rb @@ -89,14 +89,14 @@ class Nodes < Application begin @node = Chef::Node.new @node.name params[:name] - @node.normal_attrs = JSON.parse(params[:attributes]) + @node.normal_attrs = Chef::JSON.from_json(params[:attributes]) @node.run_list.reset!(params[:for_node] ? params[:for_node] : []) raise ArgumentError, "Node name cannot be blank" if (params[:name].nil? || params[:name].length==0) @node.create redirect(url(:nodes), :message => { :notice => "Created Node #{@node.name}" }) rescue => e Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}") - @node.normal_attrs = JSON.parse(params[:attributes]) + @node.normal_attrs = Chef::JSON.from_json(params[:attributes]) @available_recipes = get_available_recipes @available_roles = Chef::Role.list.keys.sort @node.run_list params[:for_node] @@ -110,7 +110,7 @@ class Nodes < Application begin @node = Chef::Node.load(params[:id]) @node.run_list.reset!(params[:for_node] ? params[:for_node] : []) - @node.normal_attrs = JSON.parse(params[:attributes]) + @node.normal_attrs = Chef::JSON.from_json(params[:attributes]) @node.save @_message = { :notice => "Updated Node" } render :show |