tenderloin 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,8 +9,8 @@ module Tenderloin
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def run_rsync
|
12
|
-
logger.info "Running rsync..."
|
13
12
|
Tenderloin.config.provisioning.rsync.each do |rsync|
|
13
|
+
logger.info "Running rsync for #{rsync.join(' -> ')}..."
|
14
14
|
src, dst = *rsync
|
15
15
|
SSH.execute(@runner.fusion_vm.ip) do |ssh|
|
16
16
|
ssh.exec!("mkdir -p #{dst}")
|
@@ -31,13 +31,16 @@ module Tenderloin
|
|
31
31
|
logger.info "Creating shared folders metadata..."
|
32
32
|
|
33
33
|
shared_folders.each do |name, hostpath, guestpath|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
for i in 0..3
|
35
|
+
begin
|
36
|
+
status = Timeout::timeout(10) {
|
37
|
+
@runner.fusion_vm.share_folder(name, File.expand_path(hostpath))
|
38
|
+
@runner.fusion_vm.enable_shared_folders
|
39
|
+
break
|
40
|
+
}
|
41
|
+
rescue Timeout::Error
|
42
|
+
logger.warn "Sharing folder #{name} timed out"
|
43
|
+
end
|
41
44
|
end
|
42
45
|
end
|
43
46
|
|
data/lib/tenderloin/ssh.rb
CHANGED
@@ -7,7 +7,7 @@ module Tenderloin
|
|
7
7
|
if options.key
|
8
8
|
Kernel.exec "#{cmd_ssh_opts} #{options.username}@#{ip}"
|
9
9
|
else
|
10
|
-
Kernel.exec cmd_ssh_opts.strip
|
10
|
+
Kernel.exec cmd_ssh_opts(ip).strip
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
@@ -49,11 +49,11 @@ module Tenderloin
|
|
49
49
|
Tenderloin.config.ssh
|
50
50
|
end
|
51
51
|
|
52
|
-
def cmd_ssh_opts
|
52
|
+
def cmd_ssh_opts(ip=nil)
|
53
53
|
if options.key
|
54
54
|
"ssh -i #{options.key} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p #{options.port}"
|
55
55
|
else
|
56
|
-
"#{SCRIPT} #{options.username} #{options.password} #{options.host} #{options.port}".strip
|
56
|
+
"#{SCRIPT} #{options.username} #{options.password} #{options.host || ip} #{options.port}".strip
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|