chef 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.
- data/lib/chef/api_client.rb +1 -1
- data/lib/chef/application/client.rb +1 -1
- data/lib/chef/application/solo.rb +1 -1
- data/lib/chef/checksum_cache.rb +1 -1
- data/lib/chef/cookbook/metadata.rb +2 -2
- data/lib/chef/couchdb.rb +1 -1
- data/lib/chef/data_bag.rb +1 -1
- data/lib/chef/data_bag_item.rb +1 -1
- data/lib/chef/exceptions.rb +1 -0
- data/lib/chef/file_cache.rb +1 -1
- data/lib/chef/handler/json_file.rb +1 -1
- data/lib/chef/index_queue/amqp_client.rb +1 -1
- data/lib/chef/index_queue/consumer.rb +1 -1
- data/lib/chef/index_queue/indexable.rb +0 -1
- data/lib/chef/{json.rb → json_compat.rb} +1 -1
- data/lib/chef/knife.rb +6 -6
- data/lib/chef/knife/bluebox_images_list.rb +1 -1
- data/lib/chef/knife/bluebox_server_create.rb +1 -1
- data/lib/chef/knife/bluebox_server_delete.rb +1 -1
- data/lib/chef/knife/bluebox_server_list.rb +1 -1
- data/lib/chef/knife/bootstrap.rb +1 -1
- data/lib/chef/knife/client_bulk_delete.rb +1 -1
- data/lib/chef/knife/client_create.rb +1 -1
- data/lib/chef/knife/client_delete.rb +1 -1
- data/lib/chef/knife/client_edit.rb +1 -1
- data/lib/chef/knife/client_list.rb +1 -1
- data/lib/chef/knife/client_reregister.rb +1 -1
- data/lib/chef/knife/client_show.rb +1 -1
- data/lib/chef/knife/cookbook_create.rb +1 -1
- data/lib/chef/knife/cookbook_list.rb +1 -1
- data/lib/chef/knife/cookbook_metadata.rb +1 -1
- data/lib/chef/knife/cookbook_show.rb +1 -1
- data/lib/chef/knife/cookbook_site_share.rb +1 -1
- data/lib/chef/knife/cookbook_site_unshare.rb +1 -0
- data/lib/chef/knife/data_bag_delete.rb +1 -0
- data/lib/chef/knife/data_bag_from_file.rb +1 -0
- data/lib/chef/knife/ec2_instance_data.rb +1 -1
- data/lib/chef/knife/ec2_server_create.rb +2 -2
- data/lib/chef/knife/ec2_server_delete.rb +1 -1
- data/lib/chef/knife/ec2_server_list.rb +1 -1
- data/lib/chef/knife/node_bulk_delete.rb +1 -1
- data/lib/chef/knife/node_create.rb +1 -1
- data/lib/chef/knife/node_delete.rb +1 -1
- data/lib/chef/knife/node_edit.rb +1 -1
- data/lib/chef/knife/node_from_file.rb +1 -1
- data/lib/chef/knife/node_list.rb +1 -1
- data/lib/chef/knife/node_run_list_add.rb +1 -1
- data/lib/chef/knife/node_run_list_remove.rb +1 -1
- data/lib/chef/knife/node_show.rb +1 -1
- data/lib/chef/knife/rackspace_server_create.rb +1 -1
- data/lib/chef/knife/rackspace_server_delete.rb +1 -1
- data/lib/chef/knife/rackspace_server_list.rb +1 -1
- data/lib/chef/knife/role_bulk_delete.rb +1 -1
- data/lib/chef/knife/role_create.rb +1 -1
- data/lib/chef/knife/role_delete.rb +1 -1
- data/lib/chef/knife/role_edit.rb +1 -1
- data/lib/chef/knife/role_from_file.rb +1 -1
- data/lib/chef/knife/role_list.rb +1 -1
- data/lib/chef/knife/role_show.rb +1 -1
- data/lib/chef/knife/slicehost_images_list.rb +1 -1
- data/lib/chef/knife/slicehost_server_create.rb +1 -1
- data/lib/chef/knife/slicehost_server_delete.rb +1 -1
- data/lib/chef/knife/slicehost_server_list.rb +1 -1
- data/lib/chef/knife/terremark_server_create.rb +1 -1
- data/lib/chef/knife/terremark_server_delete.rb +1 -1
- data/lib/chef/knife/terremark_server_list.rb +1 -1
- data/lib/chef/log.rb +10 -5
- data/lib/chef/monkey_patches/regexp.rb +34 -0
- data/lib/chef/node.rb +1 -1
- data/lib/chef/openid_registration.rb +1 -1
- data/lib/chef/provider/deploy/revision.rb +5 -1
- data/lib/chef/provider/erl_call.rb +19 -3
- data/lib/chef/provider/package/apt.rb +1 -1
- data/lib/chef/provider/package/yum.rb +29 -3
- data/lib/chef/provider/service/simple.rb +1 -1
- data/lib/chef/resource/solaris_package.rb +1 -0
- data/lib/chef/resource/yum_package.rb +1 -0
- data/lib/chef/rest.rb +12 -11
- data/lib/chef/role.rb +2 -2
- data/lib/chef/shef.rb +4 -3
- data/lib/chef/shef/ext.rb +3 -2
- data/lib/chef/shell_out.rb +5 -0
- data/lib/chef/tasks/chef_repo.rake +1 -1
- data/lib/chef/version.rb +1 -1
- data/lib/chef/webui_user.rb +1 -1
- metadata +6 -5
data/lib/chef/api_client.rb
CHANGED
@@ -181,7 +181,7 @@ class Chef::Application::Client < Chef::Application
|
|
181
181
|
end
|
182
182
|
|
183
183
|
begin
|
184
|
-
@chef_client_json = Chef::
|
184
|
+
@chef_client_json = Chef::JSONCompat.from_json(json_io.read)
|
185
185
|
json_io.close unless json_io.closed?
|
186
186
|
rescue JSON::ParserError => error
|
187
187
|
Chef::Application.fatal!("Could not parse the provided JSON file (#{Chef::Config[:json_attribs]})!: " + error.message, 2)
|
@@ -145,7 +145,7 @@ class Chef::Application::Solo < Chef::Application
|
|
145
145
|
end
|
146
146
|
|
147
147
|
begin
|
148
|
-
@chef_solo_json = Chef::
|
148
|
+
@chef_solo_json = Chef::JSONCompat.from_json(json_io.read)
|
149
149
|
json_io.close unless json_io.closed?
|
150
150
|
rescue JSON::ParserError => error
|
151
151
|
Chef::Application.fatal!("Could not parse the provided JSON file (#{Chef::Config[:json_attribs]})!: " + error.message, 2)
|
data/lib/chef/checksum_cache.rb
CHANGED
@@ -430,12 +430,12 @@ class Chef
|
|
430
430
|
end
|
431
431
|
|
432
432
|
def self.from_json(string)
|
433
|
-
o = Chef::
|
433
|
+
o = Chef::JSONCompat.from_json(string)
|
434
434
|
self.from_hash(o)
|
435
435
|
end
|
436
436
|
|
437
437
|
def from_json(string)
|
438
|
-
o = Chef::
|
438
|
+
o = Chef::JSONCompat.from_json(string)
|
439
439
|
from_hash(o)
|
440
440
|
end
|
441
441
|
|
data/lib/chef/couchdb.rb
CHANGED
data/lib/chef/data_bag.rb
CHANGED
data/lib/chef/data_bag_item.rb
CHANGED
data/lib/chef/exceptions.rb
CHANGED
@@ -24,6 +24,7 @@ class Chef
|
|
24
24
|
class Cron < RuntimeError; end
|
25
25
|
class Env < RuntimeError; end
|
26
26
|
class Exec < RuntimeError; end
|
27
|
+
class ErlCall < RuntimeError; end
|
27
28
|
class FileNotFound < RuntimeError; end
|
28
29
|
class Package < RuntimeError; end
|
29
30
|
class Service < RuntimeError; end
|
data/lib/chef/file_cache.rb
CHANGED
@@ -41,7 +41,7 @@ class Chef
|
|
41
41
|
build_report_dir
|
42
42
|
savetime = Time.now.strftime("%Y%m%d%H%M%S")
|
43
43
|
File.open(File.join(config[:path], "chef-run-report-#{savetime}.json"), "w") do |file|
|
44
|
-
file.puts Chef::
|
44
|
+
file.puts Chef::JSONCompat.to_json_pretty(data)
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
@@ -76,7 +76,7 @@ class Chef
|
|
76
76
|
def send_action(action, data)
|
77
77
|
retries = 0
|
78
78
|
begin
|
79
|
-
exchange.publish(Chef::
|
79
|
+
exchange.publish(Chef::JSONCompat.to_json({"action" => action.to_s, "payload" => data}))
|
80
80
|
rescue Bunny::ServerDownError, Bunny::ConnectionError, Errno::ECONNRESET
|
81
81
|
disconnected!
|
82
82
|
if (retries += 1) < 2
|
@@ -56,7 +56,7 @@ class Chef
|
|
56
56
|
alias :start :run
|
57
57
|
|
58
58
|
def call_action_for_message(message)
|
59
|
-
amqp_payload = Chef::
|
59
|
+
amqp_payload = Chef::JSONCompat.from_json(message[:payload], :create_additions => false, :max_nesting => false)
|
60
60
|
action = amqp_payload["action"].to_sym
|
61
61
|
app_payload = amqp_payload["payload"]
|
62
62
|
assert_method_whitelisted(action)
|
data/lib/chef/knife.rb
CHANGED
@@ -284,7 +284,7 @@ class Chef
|
|
284
284
|
def output(data)
|
285
285
|
case config[:format]
|
286
286
|
when "json", nil
|
287
|
-
stdout.puts Chef::
|
287
|
+
stdout.puts Chef::JSONCompat.to_json_pretty(data)
|
288
288
|
when "yaml"
|
289
289
|
require 'yaml'
|
290
290
|
stdout.puts YAML::dump(data)
|
@@ -330,7 +330,7 @@ class Chef
|
|
330
330
|
end
|
331
331
|
|
332
332
|
def edit_data(data, parse_output=true)
|
333
|
-
output = Chef::
|
333
|
+
output = Chef::JSONCompat.to_json_pretty(data)
|
334
334
|
|
335
335
|
if (!config[:no_editor])
|
336
336
|
filename = "knife-edit-"
|
@@ -348,7 +348,7 @@ class Chef
|
|
348
348
|
File.unlink(filename)
|
349
349
|
end
|
350
350
|
|
351
|
-
parse_output ? Chef::
|
351
|
+
parse_output ? Chef::JSONCompat.from_json(output) : output
|
352
352
|
end
|
353
353
|
|
354
354
|
def confirm(question, append_instructions=true)
|
@@ -399,7 +399,7 @@ class Chef
|
|
399
399
|
|
400
400
|
case from_file
|
401
401
|
when /\.(js|json)$/
|
402
|
-
Chef::
|
402
|
+
Chef::JSONCompat.from_json(IO.read(filename))
|
403
403
|
when /\.rb$/
|
404
404
|
r = klass.new
|
405
405
|
r.from_file(filename)
|
@@ -429,8 +429,8 @@ class Chef
|
|
429
429
|
# We wouldn't have to do these shenanigans if all the editable objects
|
430
430
|
# implemented to_hash, or if to_json against a hash returned a string
|
431
431
|
# with stable key order.
|
432
|
-
object_parsed_again = Chef::
|
433
|
-
output_parsed_again = Chef::
|
432
|
+
object_parsed_again = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(object), :create_additions => false)
|
433
|
+
output_parsed_again = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(output), :create_additions => false)
|
434
434
|
if object_parsed_again != output_parsed_again
|
435
435
|
output.save
|
436
436
|
self.msg("Saved #{output}")
|
data/lib/chef/knife/bootstrap.rb
CHANGED
@@ -69,7 +69,7 @@ class Chef
|
|
69
69
|
md.from_file(file)
|
70
70
|
json_file = File.join(File.dirname(file), 'metadata.json')
|
71
71
|
File.open(json_file, "w") do |f|
|
72
|
-
f.write(Chef::
|
72
|
+
f.write(Chef::JSONCompat.to_json_pretty(md))
|
73
73
|
end
|
74
74
|
generated = true
|
75
75
|
Chef::Log.debug("Generated #{json_file}")
|
@@ -85,7 +85,7 @@ class Chef
|
|
85
85
|
:cookbook => category_string
|
86
86
|
})
|
87
87
|
|
88
|
-
res = Chef::
|
88
|
+
res = Chef::JSONCompat.from_json(http_resp.body)
|
89
89
|
if http_resp.code.to_i != 201
|
90
90
|
if res['error_messages']
|
91
91
|
if res['error_messages'][0] =~ /Version already exists/
|
@@ -18,7 +18,7 @@
|
|
18
18
|
|
19
19
|
require 'socket'
|
20
20
|
require 'chef/knife'
|
21
|
-
require 'chef/
|
21
|
+
require 'chef/json_compat'
|
22
22
|
|
23
23
|
class Chef
|
24
24
|
class Knife
|
@@ -155,7 +155,7 @@ class Chef
|
|
155
155
|
:groups => config[:security_groups],
|
156
156
|
:flavor_id => config[:flavor],
|
157
157
|
:key_name => Chef::Config[:knife][:aws_ssh_key_id],
|
158
|
-
:availability_zone => Chef::Config[:availability_zone]
|
158
|
+
:availability_zone => Chef::Config[:knife][:availability_zone]
|
159
159
|
)
|
160
160
|
|
161
161
|
puts "#{h.color("Instance ID", :cyan)}: #{server.id}"
|