kitchen-sync 2.1.2 → 2.2.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: 68c2ae313576e55b5831f0c4ad6505cf81ff55fa
4
- data.tar.gz: 58c3069dcd286b3e27eea9c3024dc667601b3cae
3
+ metadata.gz: ba5198731d1dd70eb8db2ceef6d7840c142d32e1
4
+ data.tar.gz: c97d2770874f52912239bc74bc2aca14d04af937
5
5
  SHA512:
6
- metadata.gz: e749d9e72891b7896521d97217ad218debfb93519db0d60943c90ec1b138419cc5c761982980cf7b570787484d3c6ab49f20c9598be4d43dbbcada752ec7ff78
7
- data.tar.gz: 85b280af4158662970bf16a4fc9752b2853d8695270fdfebae55b0898bc6dc8b0953052e6c532bc30dab33c503d0c02f74ede3270eacbe26396fb20dd2f8dd42
6
+ metadata.gz: 3cb717358878edbf818963330b8a920ca3f98fcaed7575c0d2c185cb174433c6502554c9d353f04f6b6f2d5d5ed61a29a90fb6603fc62a655b0c9360c099546d
7
+ data.tar.gz: 5c8c7c0d131d8906d4269a149c38a7081fea54b586b6d8b6ff49ade103155b44c26b6053dcb990d14a6728cc577685081458555dd183b7a3c98279c88c12dbf7
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  Gemfile.lock
2
+ pkg/
2
3
 
@@ -1,5 +1,9 @@
1
1
  # Kitchen-Sync Changelog
2
2
 
3
+ ## v2.2.0
4
+
5
+ Add configurable `ruby_path` for `sftp` transport.
6
+
3
7
  ## v2.1.2
4
8
 
5
9
  Catch errors from closed sockets during instance shutdown. Fixes compat with
data/README.md CHANGED
@@ -25,6 +25,15 @@ The default mode uses SFTP for file transfers, as well as a helper script to
25
25
  avoid recopying files that are already present on the test host. If SFTP is
26
26
  disabled, this will automatically fall back to the SCP mode.
27
27
 
28
+ By default this will use the Chef omnibus Ruby, you can customize the path to
29
+ Ruby via `ruby_path`:
30
+
31
+ ```
32
+ transport:
33
+ name: sftp
34
+ ruby_path: /usr/bin/ruby
35
+ ```
36
+
28
37
  ### `rsync`
29
38
 
30
39
  The Rsync mode is based on the work done by [Mikhail Bautin](https://github.com/test-kitchen/test-kitchen/pull/359).
@@ -16,5 +16,5 @@
16
16
 
17
17
 
18
18
  class KitchenSync
19
- VERSION = '2.1.2'
19
+ VERSION = '2.2.0'
20
20
  end
@@ -32,6 +32,8 @@ module Kitchen
32
32
  CHECKSUMS_REMOTE_PATH = "/tmp/checksums-#{CHECKSUMS_HASH}.rb" # This won't work on Windows targets
33
33
  MAX_TRANSFERS = 64
34
34
 
35
+ default_config :ruby_path, '/opt/chef/embedded/bin/ruby'
36
+
35
37
  # Copy-pasta from Ssh#create_new_connection because I need the SFTP
36
38
  # connection class.
37
39
  # Tracked in https://github.com/test-kitchen/test-kitchen/pull/726
@@ -42,10 +44,15 @@ module Kitchen
42
44
  end
43
45
 
44
46
  @connection_options = options
45
- @connection = self.class::Connection.new(options, &block)
47
+ @connection = self.class::Connection.new(config, options, &block)
46
48
  end
47
49
 
48
50
  class Connection < Ssh::Connection
51
+ def initialize(config, options, &block)
52
+ @config = config
53
+ super(options, &block)
54
+ end
55
+
49
56
  # Wrap Ssh::Connection#close to also shut down the SFTP connection.
50
57
  def close
51
58
  if @sftp_session
@@ -100,7 +107,7 @@ module Kitchen
100
107
  # Get checksums for existing files on the remote side.
101
108
  logger.debug("[SFTP] Slow path upload from #{local} to #{remote}")
102
109
  copy_checksums_script!
103
- checksum_cmd = "/opt/chef/embedded/bin/ruby #{CHECKSUMS_REMOTE_PATH} #{remote}"
110
+ checksum_cmd = "#{@config[:ruby_path]} #{CHECKSUMS_REMOTE_PATH} #{remote}"
104
111
  logger.debug("[SFTP] Running #{checksum_cmd}")
105
112
  checksums = JSON.parse(session.exec!(checksum_cmd))
106
113
  # Sync files that have changed.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Kantrowitz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-20 00:00:00.000000000 Z
11
+ date: 2017-05-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -106,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  requirements: []
108
108
  rubyforge_project:
109
- rubygems_version: 2.6.4
109
+ rubygems_version: 2.6.11
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Improved file transfers for for test-kitchen