vx-container_connector 0.2.6 → 0.2.7
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd2b8b0551d449bcdc5e71117af7df9850aef1c3
|
4
|
+
data.tar.gz: fac8df9b3c35e10aee7ac712781bfcc0117c2f73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e66db65e5463f92d8c9ae708706a9d0a12848876db907cb806cb294ed6d0e35fbbbd1b5e227010c1fc782a2afd742f5889524f624197cc92ae6512dde6be379
|
7
|
+
data.tar.gz: ad366eb332fe6946d1afe98a92823a09ebbaddfe8472b9f55ee15ec83bd8d9e8c84eb6c187babe10521ec5738782db3853577ec2fb4aa6b98ca4d0cc98827afa
|
@@ -67,27 +67,20 @@ module Vx
|
|
67
67
|
forward_agent: false
|
68
68
|
}
|
69
69
|
logger.info "open ssh session to #{user}@#{host}"
|
70
|
-
|
71
|
-
begin
|
70
|
+
with_retries ::Net::SSH::AuthenticationFailed, limit: 3, sleep: 3 do
|
72
71
|
open_ssh(host, user, ssh_options) do |ssh|
|
73
72
|
logger.info "ssh session opened"
|
74
73
|
yield Spawner.new(container, ssh, remote_dir)
|
75
74
|
end
|
76
|
-
rescue ::Net::SSH::AuthenticationFailed => e
|
77
|
-
logger.error "got #{e.inspect}, retry #{attempts}"
|
78
|
-
sleep 0.5
|
79
|
-
attempts += 1
|
80
|
-
if attempts > 5
|
81
|
-
raise e
|
82
|
-
else
|
83
|
-
retry
|
84
|
-
end
|
85
75
|
end
|
86
76
|
end
|
87
77
|
|
88
78
|
def start_container(&block)
|
89
79
|
container = ::Docker::Container.create container_options
|
90
|
-
|
80
|
+
|
81
|
+
with_retries ::Docker::Error::NotFoundError, limit: 3, sleep: 3 do
|
82
|
+
container.start
|
83
|
+
end
|
91
84
|
|
92
85
|
begin
|
93
86
|
logger.info "start container #{container.id}"
|