train-core 3.3.1 → 3.3.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0245d5647c9a636cff344b8976bc6983d0f375f4e66b2baa4d2b8dccfcc98f24
4
- data.tar.gz: c8a74114fd330ffeff3063fd9d452b7142287a0502033e1f91ae9e867c9c0966
3
+ metadata.gz: 0d1528d472a38847644b9b12d7e7ebfd304e696bdfc50f7562b4b5bf387f5059
4
+ data.tar.gz: 4913341d6670668289ccc69ab4d67335d4529da28fb449a0f9fcb1dc191b571b
5
5
  SHA512:
6
- metadata.gz: 4d622422a8d022e6e8c6770d7baf5ae00afd8466029bed65ce86fc08af51308818170744edbae6cfa7242e19ced2e30f202bdf98f16aa02a43547df171c47e05
7
- data.tar.gz: dda8b333a8a2b9716e992630d65a37599a0a8a7099d52ffd3183a1cb82a2f2aeccdbca1fd5287f285b59ff931fba7a9eaa5ca3a42b65a19fa18ba9019632d355
6
+ metadata.gz: 2ab551ae2ab9e8ef40628edb76cf77f5ce0391483a2ae3aaf9ade688244817286d48bf4d92f0f3ca78e488dcf71c6783808e98a56a226df0a09867b0a281fff9
7
+ data.tar.gz: df2cc712d56b9e91239e6e10dd537b9233b0d97cfb8cb29771bb3539915f81df61523b222875791dd5dc8a9d0edbfa9f71f789cf7be74ee0164e0f504eba9c27
@@ -369,6 +369,7 @@ module Train::Platforms::Detect::Specifications
369
369
  declare_bsd("freebsd", "Freebsd", "bsd", /freebsd/i)
370
370
  declare_bsd("openbsd", "Openbsd", "bsd", /openbsd/i)
371
371
  declare_bsd("netbsd", "Netbsd", "bsd", /netbsd/i)
372
+ declare_bsd("dragonflybsd", "Dragonflybsd", "bsd", /dragonfly/i)
372
373
  end
373
374
 
374
375
  def self.load_other
@@ -65,6 +65,9 @@ module Train::Transports
65
65
  option :non_interactive, default: false
66
66
  option :verify_host_key, default: false
67
67
 
68
+ # Allow connecting with older algorithms
69
+ option :append_all_supported_algorithms, default: true
70
+
68
71
  option :compression_level do |opts|
69
72
  # on nil or false: set compression level to 0
70
73
  opts[:compression] ? 6 : 0
@@ -76,7 +79,7 @@ module Train::Transports
76
79
  validate_options(opts)
77
80
  conn_opts = connection_options(opts)
78
81
 
79
- if defined?(@connection) && @connection_options == conn_opts
82
+ if defined?(@connection) && reusable_connection?(conn_opts)
80
83
  reuse_connection(&block)
81
84
  else
82
85
  create_new_connection(conn_opts, &block)
@@ -85,6 +88,13 @@ module Train::Transports
85
88
 
86
89
  private
87
90
 
91
+ def reusable_connection?(conn_opts)
92
+ return false unless @connection_options
93
+
94
+ # Do requested options match their current settings
95
+ @connection_options.all? { |k, v| conn_opts[k] == v }
96
+ end
97
+
88
98
  def validate_options(options)
89
99
  super(options)
90
100
 
@@ -167,6 +177,7 @@ module Train::Transports
167
177
  bastion_user: opts[:bastion_user],
168
178
  bastion_port: opts[:bastion_port],
169
179
  non_interactive: opts[:non_interactive],
180
+ append_all_supported_algorithms: opts[:append_all_supported_algorithms],
170
181
  transport_options: opts,
171
182
  }
172
183
  # disable host key verification. The hash key and value to use
@@ -202,8 +202,6 @@ class Train::Transports::SSH
202
202
  require "net/ssh/proxy/command"
203
203
  @options[:proxy] = Net::SSH::Proxy::Command.new(generate_proxy_command)
204
204
  end
205
- # Allow older algorithms
206
- @options[:append_all_supported_algorithms] = true
207
205
  Net::SSH.start(@hostname, @username, @options.clone.delete_if { |_key, value| value.nil? })
208
206
  rescue *RESCUE_EXCEPTIONS_ON_ESTABLISH => e
209
207
  if (opts[:retries] -= 1) <= 0
@@ -3,5 +3,5 @@
3
3
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
4
4
 
5
5
  module Train
6
- VERSION = "3.3.1".freeze
6
+ VERSION = "3.3.4".freeze
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: train-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.1
4
+ version: 3.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chef InSpec Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-10 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable