train 0.27.0 → 0.28.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: 802cb7956050b4a8db80e8260bcafab0802ba46f
4
- data.tar.gz: 372b756cae6c8b8fc34e57eee61521545098e312
3
+ metadata.gz: eca87a39cc3d6258174e753e4533c05f9508ac24
4
+ data.tar.gz: 82689ec956034e7e19b96d0f749bced3964c7fa7
5
5
  SHA512:
6
- metadata.gz: a831de36739909f5803dfce9bccd3a1de0061af38087d3b7d1af37e42b87ef8f7465c1b776b47cda5add839a2d807b7254ff9cfc9d44ad15a688a635952c183a
7
- data.tar.gz: c71f0bcb8eb7908076ad5d282975e8dfe10ee99a9bd1faebba374c43173543c4f35488eefe63a1a0f29957ed8e56abd7c01d67f0e89622d880b0c7cd6f2c2f14
6
+ metadata.gz: e984b1624f89dee67e5dbf0014db3b3d7f40b3a24a7a68bc1e5bfdb212c080940427ca167df8799f3fa1b54ae7c801791661e8d000e497de853703e5fcb4b01d
7
+ data.tar.gz: 67639d931b4d15c01ef5feafdc80c2bba5b02b3f78d6ec90d04124cb7e2d195475c17d14d52e3070bf07720b8a3d433b25effa88a3dba03ec5ef901952696301
@@ -1,10 +1,18 @@
1
1
  # Change Log
2
2
 
3
- ## [0.27.0](https://github.com/chef/train/tree/0.27.0) (2017-09-25)
4
- [Full Changelog](https://github.com/chef/train/compare/v0.26.2...0.27.0)
3
+ ## [0.28.0](https://github.com/chef/train/tree/0.28.0) (2017-09-25)
4
+ [Full Changelog](https://github.com/chef/train/compare/v0.27.0...0.28.0)
5
5
 
6
6
  **Merged pull requests:**
7
7
 
8
+ - Continue to support older net-ssh while fixing 4.2 deprecation [\#199](https://github.com/chef/train/pull/199) ([adamleff](https://github.com/adamleff))
9
+
10
+ ## [v0.27.0](https://github.com/chef/train/tree/v0.27.0) (2017-09-25)
11
+ [Full Changelog](https://github.com/chef/train/compare/v0.26.2...v0.27.0)
12
+
13
+ **Merged pull requests:**
14
+
15
+ - Release v0.27.0 [\#198](https://github.com/chef/train/pull/198) ([adamleff](https://github.com/adamleff))
8
16
  - Bump to net-ssh 4.2, fix bad net-ssh deprecation [\#197](https://github.com/chef/train/pull/197) ([adamleff](https://github.com/adamleff))
9
17
 
10
18
  ## [v0.26.2](https://github.com/chef/train/tree/v0.26.2) (2017-09-05)
@@ -33,7 +33,7 @@ module Train::Transports
33
33
  # files.
34
34
  #
35
35
  # @author Fletcher Nichol <fnichol@nichol.ca>
36
- class SSH < Train.plugin(1)
36
+ class SSH < Train.plugin(1) # rubocop:disable Metrics/ClassLength
37
37
  name 'ssh'
38
38
 
39
39
  require 'train/transports/ssh_connection'
@@ -131,10 +131,9 @@ module Train::Transports
131
131
  # @return [Hash] hash of connection options
132
132
  # @api private
133
133
  def connection_options(opts)
134
- {
134
+ connection_options = {
135
135
  logger: logger,
136
136
  user_known_hosts_file: '/dev/null',
137
- verify_host_key: false,
138
137
  hostname: opts[:host],
139
138
  port: opts[:port],
140
139
  username: opts[:user],
@@ -153,6 +152,31 @@ module Train::Transports
153
152
  forward_agent: opts[:forward_agent],
154
153
  transport_options: opts,
155
154
  }
155
+
156
+ # disable host key verification. The hash key to use
157
+ # depends on the version of net-ssh in use.
158
+ connection_options[verify_host_key_option] = false
159
+
160
+ connection_options
161
+ end
162
+
163
+ #
164
+ # Returns the correct host-key-verification option key to use depending
165
+ # on what version of net-ssh is in use. In net-ssh <= 4.1, the supported
166
+ # parameter is `paranoid` but in 4.2, it became `verify_host_key`
167
+ #
168
+ # `verify_host_key` does not work in <= 4.1, and `paranoid` throws
169
+ # deprecation warnings in >= 4.2.
170
+ #
171
+ # While the "right thing" to do would be to pin train's dependency on
172
+ # net-ssh to ~> 4.2, this will prevent InSpec from being used in
173
+ # Chef v12 because of it pinning to a v3 of net-ssh.
174
+ #
175
+ def verify_host_key_option
176
+ current_net_ssh = Net::SSH::Version::CURRENT
177
+ new_option_version = Net::SSH::Version[4, 2, 0]
178
+
179
+ current_net_ssh >= new_option_version ? :verify_host_key : :paranoid
156
180
  end
157
181
 
158
182
  # Creates a new SSH Connection instance and save it for potential future
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = '0.27.0'.freeze
6
+ VERSION = '0.28.0'.freeze
7
7
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_dependency 'mixlib-shellout', '~> 2.0'
29
29
  # net-ssh 3.x drops Ruby 1.9 support, so this constraint could be raised when
30
30
  # 1.9 support is no longer needed here or for Inspec
31
- spec.add_dependency 'net-ssh', '~> 4.2'
31
+ spec.add_dependency 'net-ssh', '>= 2.9', '< 5.0'
32
32
  spec.add_dependency 'net-scp', '~> 1.2'
33
33
  spec.add_dependency 'winrm', '~> 2.0'
34
34
  spec.add_dependency 'winrm-fs', '~> 1.0'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
@@ -48,16 +48,22 @@ dependencies:
48
48
  name: net-ssh
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - "~>"
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '2.9'
54
+ - - "<"
52
55
  - !ruby/object:Gem::Version
53
- version: '4.2'
56
+ version: '5.0'
54
57
  type: :runtime
55
58
  prerelease: false
56
59
  version_requirements: !ruby/object:Gem::Requirement
57
60
  requirements:
58
- - - "~>"
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '2.9'
64
+ - - "<"
59
65
  - !ruby/object:Gem::Version
60
- version: '4.2'
66
+ version: '5.0'
61
67
  - !ruby/object:Gem::Dependency
62
68
  name: net-scp
63
69
  requirement: !ruby/object:Gem::Requirement