microwave 0.1004.2 → 0.1004.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/chef/application/solo.rb +1 -53
- data/lib/chef/client.rb +5 -7
- data/lib/chef/config.rb +0 -4
- data/lib/chef/version.rb +1 -1
- metadata +3 -3
|
@@ -64,12 +64,6 @@ class Chef::Application::Solo < Chef::Application
|
|
|
64
64
|
:description => "Group to set privilege to",
|
|
65
65
|
:proc => nil
|
|
66
66
|
|
|
67
|
-
option :json_attribs,
|
|
68
|
-
:short => "-j JSON_ATTRIBS",
|
|
69
|
-
:long => "--json-attributes JSON_ATTRIBS",
|
|
70
|
-
:description => "Load attributes from a JSON file or URL",
|
|
71
|
-
:proc => nil
|
|
72
|
-
|
|
73
67
|
option :node_name,
|
|
74
68
|
:short => "-N NODE_NAME",
|
|
75
69
|
:long => "--node-name NODE_NAME",
|
|
@@ -82,12 +76,6 @@ class Chef::Application::Solo < Chef::Application
|
|
|
82
76
|
:description => "The splay time for running at intervals, in seconds",
|
|
83
77
|
:proc => lambda { |s| s.to_i }
|
|
84
78
|
|
|
85
|
-
option :recipe_url,
|
|
86
|
-
:short => "-r RECIPE_URL",
|
|
87
|
-
:long => "--recipe-url RECIPE_URL",
|
|
88
|
-
:description => "Pull down a remote gzipped tarball of recipes and untar it to the cookbook cache.",
|
|
89
|
-
:proc => nil
|
|
90
|
-
|
|
91
79
|
option :version,
|
|
92
80
|
:short => "-v",
|
|
93
81
|
:long => "--version",
|
|
@@ -103,53 +91,13 @@ class Chef::Application::Solo < Chef::Application
|
|
|
103
91
|
:boolean => true,
|
|
104
92
|
:proc => lambda {|n| $testrun = true }
|
|
105
93
|
|
|
106
|
-
attr_reader :chef_solo_json
|
|
107
|
-
|
|
108
94
|
def initialize
|
|
109
95
|
super
|
|
110
96
|
@chef_solo = nil
|
|
111
|
-
@chef_solo_json = nil
|
|
112
97
|
end
|
|
113
98
|
|
|
114
99
|
def reconfigure
|
|
115
100
|
super
|
|
116
|
-
|
|
117
|
-
if Chef::Config[:json_attribs]
|
|
118
|
-
begin
|
|
119
|
-
json_io = open(Chef::Config[:json_attribs])
|
|
120
|
-
rescue SocketError => error
|
|
121
|
-
Chef::Application.fatal!("I cannot connect to #{Chef::Config[:json_attribs]}", 2)
|
|
122
|
-
rescue Errno::ENOENT => error
|
|
123
|
-
Chef::Application.fatal!("I cannot find #{Chef::Config[:json_attribs]}", 2)
|
|
124
|
-
rescue Errno::EACCES => error
|
|
125
|
-
Chef::Application.fatal!("Permissions are incorrect on #{Chef::Config[:json_attribs]}. Please chmod a+r #{Chef::Config[:json_attribs]}", 2)
|
|
126
|
-
rescue Exception => error
|
|
127
|
-
Chef::Application.fatal!("Got an unexpected error reading #{Chef::Config[:json_attribs]}: #{error.message}", 2)
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
begin
|
|
131
|
-
@chef_solo_json = Chef::JSONCompat.from_json(json_io.read)
|
|
132
|
-
json_io.close unless json_io.closed?
|
|
133
|
-
rescue JSON::ParserError => error
|
|
134
|
-
Chef::Application.fatal!("Could not parse the provided JSON file (#{Chef::Config[:json_attribs]})!: " + error.message, 2)
|
|
135
|
-
end
|
|
136
|
-
end
|
|
137
|
-
|
|
138
|
-
if Chef::Config[:recipe_url]
|
|
139
|
-
cookbooks_path = Array(Chef::Config[:cookbook_path]).detect{|e| e =~ /\/cookbooks\/*$/ }
|
|
140
|
-
recipes_path = File.expand_path(File.join(cookbooks_path, '..'))
|
|
141
|
-
target_file = File.join(recipes_path, 'recipes.tgz')
|
|
142
|
-
|
|
143
|
-
Chef::Log.debug "Creating path #{recipes_path} to extract recipes into"
|
|
144
|
-
FileUtils.mkdir_p recipes_path
|
|
145
|
-
path = File.join(recipes_path, 'recipes.tgz')
|
|
146
|
-
File.open(path, 'wb') do |f|
|
|
147
|
-
open(Chef::Config[:recipe_url]) do |r|
|
|
148
|
-
f.write(r.read)
|
|
149
|
-
end
|
|
150
|
-
end
|
|
151
|
-
Chef::Mixin::Command.run_command(:command => "tar zxvfC #{path} #{recipes_path}")
|
|
152
|
-
end
|
|
153
101
|
end
|
|
154
102
|
|
|
155
103
|
def setup_application
|
|
@@ -164,7 +112,7 @@ class Chef::Application::Solo < Chef::Application
|
|
|
164
112
|
sleep splay
|
|
165
113
|
end
|
|
166
114
|
|
|
167
|
-
@chef_solo = Chef::Client.new
|
|
115
|
+
@chef_solo = Chef::Client.new
|
|
168
116
|
@chef_solo.run
|
|
169
117
|
@chef_solo = nil
|
|
170
118
|
Chef::Application.exit! "Exiting", 0
|
data/lib/chef/client.rb
CHANGED
|
@@ -113,15 +113,10 @@ class Chef
|
|
|
113
113
|
attr_accessor :rest
|
|
114
114
|
attr_accessor :runner
|
|
115
115
|
|
|
116
|
-
#--
|
|
117
|
-
# TODO: timh/cw: 5-19-2010: json_attribs should be moved to RunContext?
|
|
118
|
-
attr_reader :json_attribs
|
|
119
|
-
|
|
120
116
|
attr_reader :run_status
|
|
121
117
|
|
|
122
118
|
# Creates a new Chef::Client.
|
|
123
|
-
def initialize
|
|
124
|
-
@json_attribs = json_attribs
|
|
119
|
+
def initialize
|
|
125
120
|
@node = nil
|
|
126
121
|
@run_status = nil
|
|
127
122
|
@runner = nil
|
|
@@ -222,11 +217,14 @@ class Chef
|
|
|
222
217
|
@node.chef_environment(Chef::Config[:environment])
|
|
223
218
|
end
|
|
224
219
|
|
|
220
|
+
# tom: no longer using json_attribs with consume_external_attrs,
|
|
221
|
+
# preferring to load from a node.rb
|
|
222
|
+
#
|
|
225
223
|
# consume_external_attrs may add items to the run_list. Save the
|
|
226
224
|
# expanded run_list, which we will pass to the server later to
|
|
227
225
|
# determine which versions of cookbooks to use.
|
|
228
226
|
@node.reset_defaults_and_overrides
|
|
229
|
-
@node.
|
|
227
|
+
@node.find_file(node_name)
|
|
230
228
|
@run_list_expansion = @node.expand!('disk')
|
|
231
229
|
|
|
232
230
|
# @run_list_expansion is a RunListExpansion.
|
data/lib/chef/config.rb
CHANGED
|
@@ -103,7 +103,6 @@ class Chef
|
|
|
103
103
|
http_retry_count 5
|
|
104
104
|
http_retry_delay 5
|
|
105
105
|
interval nil
|
|
106
|
-
json_attribs nil
|
|
107
106
|
log_level :info
|
|
108
107
|
log_location STDOUT
|
|
109
108
|
verbose_logging nil
|
|
@@ -130,9 +129,6 @@ class Chef
|
|
|
130
129
|
# Where should chef-solo look for role files?
|
|
131
130
|
role_path "/var/chef/roles"
|
|
132
131
|
|
|
133
|
-
# Where should chef-solo download recipes from?
|
|
134
|
-
recipe_url nil
|
|
135
|
-
|
|
136
132
|
# Report Handlers
|
|
137
133
|
report_handlers []
|
|
138
134
|
|
data/lib/chef/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: microwave
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 4009
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1004
|
|
9
|
-
-
|
|
10
|
-
version: 0.1004.
|
|
9
|
+
- 3
|
|
10
|
+
version: 0.1004.3
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Tom Bombadil
|