kitchen-sync 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen-sync/version.rb +1 -1
- data/lib/kitchen/transport/sftp.rb +20 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0376fdf7d97ee105cfbfb248cd7a42ffd0e6132c
|
4
|
+
data.tar.gz: 6fa0f7cb5fd4dd9eba236520f17de3591a507f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f587f0f0b9885937e4e5852e98bb308ae6105ea2a0c3b9d9ed76cbf24a37e181a1651c72055c39ff564f7aa6b00893bb36796eb5127a9d4e1fef747e20d0234
|
7
|
+
data.tar.gz: e82b6548d9f31de4acb86f4ee12ace4a9b1644078f116e12735291f1b6d99f0033dd8c0de70173b2eda1acd48db14330443a13064ed0b382296d8f4be21d5ef6
|
data/lib/kitchen-sync/version.rb
CHANGED
@@ -50,11 +50,23 @@ module Kitchen
|
|
50
50
|
def close
|
51
51
|
if @sftp_session
|
52
52
|
logger.debug("[SFTP] closing connection to #{self}")
|
53
|
-
|
53
|
+
begin
|
54
|
+
sftp_session.close_channel
|
55
|
+
rescue Net::SSH::Disconnect
|
56
|
+
# Welp, we tried.
|
57
|
+
end
|
54
58
|
end
|
55
59
|
ensure
|
56
60
|
@sftp_session = nil
|
57
|
-
|
61
|
+
# Make sure we can turn down the session even if closing the channels
|
62
|
+
# fails in the middle because of a remote disconnect.
|
63
|
+
saved_session = @session
|
64
|
+
begin
|
65
|
+
super
|
66
|
+
rescue Net::SSH::Disconnect
|
67
|
+
# Boooo zlib warnings.
|
68
|
+
saved_session.transport.close if saved_session
|
69
|
+
end
|
58
70
|
end
|
59
71
|
|
60
72
|
def upload(locals, remote)
|
@@ -99,6 +111,7 @@ module Kitchen
|
|
99
111
|
# Tracked in https://github.com/test-kitchen/test-kitchen/pull/724
|
100
112
|
def execute_with_exit_code(command)
|
101
113
|
exit_code = nil
|
114
|
+
closed = false
|
102
115
|
session.open_channel do |channel|
|
103
116
|
|
104
117
|
channel.request_pty
|
@@ -116,9 +129,13 @@ module Kitchen
|
|
116
129
|
channel.on_request("exit-status") do |_ch, data|
|
117
130
|
exit_code = data.read_long
|
118
131
|
end
|
132
|
+
|
133
|
+
channel.on_close do |ch| # This block is new.
|
134
|
+
closed = true
|
135
|
+
end
|
119
136
|
end
|
120
137
|
end
|
121
|
-
session.loop { exit_code.nil? } # THERE IS A CHANGE ON THIS LINE, PAY ATTENTION!!!!!!
|
138
|
+
session.loop { exit_code.nil? && !closed } # THERE IS A CHANGE ON THIS LINE, PAY ATTENTION!!!!!!
|
122
139
|
exit_code
|
123
140
|
end
|
124
141
|
|
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.
|
4
|
+
version: 2.1.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: 2016-01-
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|