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 +4 -4
- data/CHANGELOG.md +10 -2
- data/lib/train/transports/ssh.rb +27 -3
- data/lib/train/version.rb +1 -1
- data/train.gemspec +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca87a39cc3d6258174e753e4533c05f9508ac24
|
4
|
+
data.tar.gz: 82689ec956034e7e19b96d0f749bced3964c7fa7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e984b1624f89dee67e5dbf0014db3b3d7f40b3a24a7a68bc1e5bfdb212c080940427ca167df8799f3fa1b54ae7c801791661e8d000e497de853703e5fcb4b01d
|
7
|
+
data.tar.gz: 67639d931b4d15c01ef5feafdc80c2bba5b02b3f78d6ec90d04124cb7e2d195475c17d14d52e3070bf07720b8a3d433b25effa88a3dba03ec5ef901952696301
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,18 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.
|
4
|
-
[Full Changelog](https://github.com/chef/train/compare/v0.
|
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)
|
data/lib/train/transports/ssh.rb
CHANGED
@@ -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
|
data/lib/train/version.rb
CHANGED
data/train.gemspec
CHANGED
@@ -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', '
|
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.
|
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: '
|
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: '
|
66
|
+
version: '5.0'
|
61
67
|
- !ruby/object:Gem::Dependency
|
62
68
|
name: net-scp
|
63
69
|
requirement: !ruby/object:Gem::Requirement
|