chef-server-webui 0.9.14.beta.1 → 0.9.14.rc.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,7 @@ class DatabagItems < Application
38
38
  begin
39
39
  @databag_item = Chef::DataBagItem.new
40
40
  @databag_item.data_bag params[:databag_id]
41
- @databag_item.raw_data = Chef::JSON.from_json(params[:json_data])
41
+ @databag_item.raw_data = Chef::JSONCompat.from_json(params[:json_data])
42
42
  raise ArgumentError, "Updating id is not allowed" unless @databag_item.raw_data['id'] == params[:id] #to be consistent with other objects, changing id is not allowed.
43
43
  @databag_item.save
44
44
  redirect(url(:databag_databag_items, :databag_id => params[:databag_id], :id => @databag_item.name), :message => { :notice => "Updated Databag Item #{@databag_item.name}" })
@@ -61,7 +61,7 @@ class DatabagItems < Application
61
61
  @databag_name = params[:databag_id]
62
62
  @databag_item = Chef::DataBagItem.new
63
63
  @databag_item.data_bag @databag_name
64
- @databag_item.raw_data = Chef::JSON.from_json(params[:json_data])
64
+ @databag_item.raw_data = Chef::JSONCompat.from_json(params[:json_data])
65
65
  @databag_item.create
66
66
  redirect(url(:databag_databag_items, :databag_id => @databag_name), :message => { :notice => "Databag item created successfully" })
67
67
  rescue => e
@@ -89,15 +89,15 @@ class Nodes < Application
89
89
  begin
90
90
  @node = Chef::Node.new
91
91
  @node.name params[:name]
92
- @node.normal_attrs = Chef::JSON.from_json(params[:attributes])
92
+ @node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
93
93
  @node.run_list.reset!(params[:for_node] ? params[:for_node] : [])
94
94
  raise ArgumentError, "Node name cannot be blank" if (params[:name].nil? || params[:name].length==0)
95
95
  @node.create
96
96
  redirect(url(:nodes), :message => { :notice => "Created Node #{@node.name}" })
97
97
  rescue => e
98
98
  Chef::Log.error("#{e}\n#{e.backtrace.join("\n")}")
99
- @node.normal_attrs = Chef::JSON.from_json(params[:attributes])
100
- @available_recipes = get_available_recipes
99
+ @node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
100
+ @available_recipes = get_available_recipes
101
101
  @available_roles = Chef::Role.list.keys.sort
102
102
  @node.run_list params[:for_node]
103
103
  @run_list = @node.run_list
@@ -110,7 +110,7 @@ class Nodes < Application
110
110
  begin
111
111
  @node = Chef::Node.load(params[:id])
112
112
  @node.run_list.reset!(params[:for_node] ? params[:for_node] : [])
113
- @node.normal_attrs = Chef::JSON.from_json(params[:attributes])
113
+ @node.normal_attrs = Chef::JSONCompat.from_json(params[:attributes])
114
114
  @node.save
115
115
  @_message = { :notice => "Updated Node" }
116
116
  render :show
@@ -90,8 +90,8 @@ class Roles < Application
90
90
  @role.name(params[:name])
91
91
  @role.run_list(params[:for_role] ? params[:for_role] : [])
92
92
  @role.description(params[:description]) if params[:description] != ''
93
- @role.default_attributes(Chef::JSON.from_json(params[:default_attributes])) if params[:default_attributes] != ''
94
- @role.override_attributes(Chef::JSON.from_json(params[:override_attributes])) if params[:override_attributes] != ''
93
+ @role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
94
+ @role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
95
95
  @role.create
96
96
  redirect(url(:roles), :message => { :notice => "Created Role #{@role.name}" })
97
97
  rescue => e
@@ -99,8 +99,8 @@ class Roles < Application
99
99
  @available_recipes = get_available_recipes
100
100
  @available_roles = Chef::Role.list.keys.sort
101
101
  @role = Chef::Role.new
102
- @role.default_attributes(Chef::JSON.from_json(params[:default_attributes])) if params[:default_attributes] != ''
103
- @role.override_attributes(Chef::JSON.from_json(params[:override_attributes])) if params[:override_attributes] != ''
102
+ @role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
103
+ @role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
104
104
  @run_list = Chef::RunList.new.reset!(Array(params[:for_role]))
105
105
  @_message = { :error => "Could not create role" }
106
106
  render :new
@@ -113,8 +113,8 @@ class Roles < Application
113
113
  @role = Chef::Role.load(params[:id])
114
114
  @role.run_list(params[:for_role] ? params[:for_role] : [])
115
115
  @role.description(params[:description]) if params[:description] != ''
116
- @role.default_attributes(Chef::JSON.from_json(params[:default_attributes])) if params[:default_attributes] != ''
117
- @role.override_attributes(Chef::JSON.from_json(params[:override_attributes])) if params[:override_attributes] != ''
116
+ @role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
117
+ @role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
118
118
  @role.save
119
119
  @_message = { :notice => "Updated Role" }
120
120
  render :show
@@ -124,8 +124,8 @@ class Roles < Application
124
124
  @available_roles = Chef::Role.list.keys.sort
125
125
  @run_list = Chef::RunList.new.reset!( Array(params[:for_role]))
126
126
  Chef::Log.error(@run_list.inspect)
127
- @role.default_attributes(Chef::JSON.from_json(params[:default_attributes])) if params[:default_attributes] != ''
128
- @role.override_attributes(Chef::JSON.from_json(params[:override_attributes])) if params[:override_attributes] != ''
127
+ @role.default_attributes(Chef::JSONCompat.from_json(params[:default_attributes])) if params[:default_attributes] != ''
128
+ @role.override_attributes(Chef::JSONCompat.from_json(params[:override_attributes])) if params[:override_attributes] != ''
129
129
  @_message = {:error => "Could not update role #{params[:id]}"}
130
130
  render :edit
131
131
  end
@@ -1,3 +1,3 @@
1
1
  module ChefServerWebui
2
- VERSION = '0.9.14.beta.1'
2
+ VERSION = '0.9.14.rc.1'
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-server-webui
3
3
  version: !ruby/object:Gem::Version
4
- hash: 62196289
4
+ hash: 15424247
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 14
10
- - beta
10
+ - rc
11
11
  - 1
12
- version: 0.9.14.beta.1
12
+ version: 0.9.14.rc.1
13
13
  platform: ruby
14
14
  authors:
15
15
  - Opscode
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-02-09 00:00:00 -08:00
20
+ date: 2011-02-25 00:00:00 -08:00
21
21
  default_executable:
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency