chef-provisioning 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e3304a5ecfc8f5bea393fa3726fc0d42fa302f67
4
- data.tar.gz: 0a10809301c0dea45997d8ae05de2d3abe50ff6a
3
+ metadata.gz: 88e66a0f2f8ba08fe89dd0bacfafc5347e60ab1e
4
+ data.tar.gz: 8613f4903f14bfbee91ad754733a666c7f926b57
5
5
  SHA512:
6
- metadata.gz: 5e49ae5b867145555c90fcc3db39c46b10590045455222653d8ca2215cb8300e7d4ef1094d2842b50459998a58838dea5c663652724d57f74c9fdee35a899cd4
7
- data.tar.gz: c98943e0ca2c338e9973815588d081e49ee4cd86b07a3e55666eda8740a3f47cfab02c1ed257ff05921f4a6b3398a7aa0a6bda594c12e958a91d656f5236bc93
6
+ metadata.gz: 7573ea723df0c01690c01e593f135c1fd3eeac2e0279a521befba486251f045bb51cf5b8af614b9a91f17f835c90af3ce831b33265533bbd88aadf22cd5fa79a
7
+ data.tar.gz: 773f45f5108f16e456bc75f6fd1bdb2e54f5daa3d35d1a13eb19dd6c17c631e041df21262ed10cdaa567ec1f110c009224c787c54fe7fb135ee5f81bf26d1dc9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Chef Provisioning Changelog
2
2
 
3
+ ## 1.1.0
4
+
5
+ - Fix machine_batch :destroy, no longer creating extra threads ([#321][])
6
+ - Allow user to specify a custom stdout in `Chef::Config[:stdout]` ([#311][])
7
+ - If `convergence_options[:bootstrap_proxy]` is populated use it to download chef ([#317][])
8
+
3
9
  ## 1.0.1 (4/7/2015)
4
10
 
5
11
  - Clean up dependencies ([#316][])
@@ -279,7 +285,10 @@
279
285
  [#297]: https://github.com/chef/chef-provisioning/issues/297
280
286
  [#299]: https://github.com/chef/chef-provisioning/issues/299
281
287
  [#303]: https://github.com/chef/chef-provisioning/issues/303
288
+ [#311]: https://github.com/chef/chef-provisioning/issues/311
282
289
  [#316]: https://github.com/chef/chef-provisioning/issues/316
290
+ [#317]: https://github.com/chef/chef-provisioning/issues/317
291
+ [#321]: https://github.com/chef/chef-provisioning/issues/321
283
292
  [@MrMMorris]: https://github.com/MrMMorris
284
293
  [@causton1]: https://github.com/causton1
285
294
  [@chef]: https://github.com/chef
@@ -296,4 +305,4 @@
296
305
  [@mwrock]: https://github.com/mwrock
297
306
  [@segv]: https://github.com/segv
298
307
  [@xeon22]: https://github.com/xeon22
299
- [@xorl]: https://github.com/xorl
308
+ [@xorl]: https://github.com/xorl
@@ -77,7 +77,7 @@ class MachineBatch < Chef::Provider::LWRPBase
77
77
  action :destroy do
78
78
  parallel_do(by_current_driver) do |driver, specs_and_options|
79
79
  driver.destroy_machines(action_handler, specs_and_options, parallelizer)
80
- parallel_do(specs_and_options.keys).each do |machine_spec|
80
+ specs_and_options.keys.each do |machine_spec|
81
81
  machine_spec.delete(action_handler)
82
82
  end
83
83
  end
@@ -64,7 +64,20 @@ module Provisioning
64
64
 
65
65
  # Install chef client
66
66
  # TODO ssh verification of install.sh before running arbtrary code would be nice?
67
- @@install_sh_cache[install_sh_url] ||= Net::HTTP.get(URI(install_sh_url))
67
+ if convergence_options[:bootstrap_proxy].empty?
68
+ @@install_sh_cache[install_sh_url] ||= Net::HTTP.get(URI(install_sh_url))
69
+ else
70
+ @@install_sh_cache[install_sh_url] ||= begin
71
+ proxy_uri = URI.parse(convergence_options[:bootstrap_proxy])
72
+ chef_uri = URI.parse(@install_sh_url)
73
+ proxy = Net::HTTP::Proxy(proxy_uri.host, proxy_uri.port, proxy_uri.user, proxy_uri.password)
74
+ req = Net::HTTP::Get.new(chef_uri.path)
75
+ script = proxy.start(chef_uri.host, :use_ssl => proxy_uri.scheme == 'https') do |http|
76
+ http.request(req)
77
+ end
78
+ script.body
79
+ end
80
+ end
68
81
  machine.write_file(action_handler, install_sh_path, @@install_sh_cache[install_sh_url], :ensure_dir => true)
69
82
  # TODO handle bad version case better
70
83
  machine.execute(action_handler, install_sh_command_line)
@@ -67,18 +67,23 @@ module Provisioning
67
67
  options[:stream].call(stdout_chunk, stderr_chunk)
68
68
  else
69
69
  if stdout_chunk
70
- if options[:stream_stdout]
71
- options[:stream_stdout].print stdout_chunk
70
+ if options.has_key?(:stream_stdout)
71
+ stream = options[:stream_stdout]
72
72
  elsif options[:stream] || config[:log_level] == :debug
73
- STDOUT.print stdout_chunk
73
+ stream = config[:stdout] || STDOUT
74
74
  end
75
+
76
+ stream.print stdout_chunk if stream
75
77
  end
78
+
76
79
  if stderr_chunk
77
- if options[:stream_stderr]
78
- options[:stream_stderr].print stderr_chunk
80
+ if options.has_key?(:stream_stderr)
81
+ stream = options[:stream_stderr]
79
82
  elsif options[:stream] || config[:log_level] == :debug
80
- STDERR.print stderr_chunk
83
+ stream = config[:stderr] || STDERR
81
84
  end
85
+
86
+ stream.print stderr_chunk if stream
82
87
  end
83
88
  end
84
89
  end
@@ -90,6 +90,7 @@ module Provisioning
90
90
  SSHResult.new(command, execute_options, stdout, stderr, exitstatus)
91
91
  end
92
92
 
93
+ # TODO why does #read_file download it to the target host?
93
94
  def read_file(path)
94
95
  Chef::Log.debug("Reading file #{path} from #{username}@#{host}")
95
96
  result = StringIO.new
@@ -208,7 +209,7 @@ module Provisioning
208
209
  execute("chown #{username} #{remote_tempfile}").error!
209
210
  do_download remote_tempfile, local_path
210
211
  rescue => e
211
- Chef::Log.error "Unable to download #{path} to #{local_path} on #{username}@#{host} -- #{e}"
212
+ Chef::Log.error "Unable to download #{path} to #{remote_tempfile} on #{username}@#{host} -- #{e}"
212
213
  nil
213
214
  ensure
214
215
  # Clean up afterwards
@@ -1,5 +1,5 @@
1
1
  class Chef
2
2
  module Provisioning
3
- VERSION = '1.0.1'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-provisioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-07 00:00:00.000000000 Z
11
+ date: 2015-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: chef