specinfra 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/specinfra/backend/ssh.rb +10 -4
- data/lib/specinfra/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a2dbc0cad70c29af27ba9302a8f8e2c12ee0319
|
4
|
+
data.tar.gz: 44678a39c8799d2a3d3f3345395afc158cf81694
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c8206acbcbd6d1cf32699c5eacc586d1ce80f3a614bdc8adca7857e2ecc1532a586699729e8a77bf6d692a88fb1063ca4588e0805e2be2e524a9fe529bb5e68
|
7
|
+
data.tar.gz: b2ec935f95136a99b787fbe2fcfcc5a156c603c934550fa302cfbff0f0052bfe285ef6f80aa581963eb60755a9cb56a8e86c32f8d919dd4f6b455a6965d86eaf
|
@@ -61,14 +61,16 @@ module SpecInfra
|
|
61
61
|
|
62
62
|
ssh = SpecInfra.configuration.ssh
|
63
63
|
ssh.open_channel do |channel|
|
64
|
-
|
65
|
-
|
64
|
+
if not SpecInfra.configuration.sudo_password.nil?
|
65
|
+
# We don't need a PTY because we don't have a sudo password
|
66
|
+
channel.request_pty do |ch, success|
|
67
|
+
abort "Could not obtain pty " if !success
|
68
|
+
end
|
66
69
|
end
|
67
70
|
channel.exec("#{command}") do |ch, success|
|
68
71
|
abort "FAILED: couldn't execute command (ssh.channel.exec)" if !success
|
69
72
|
channel.on_data do |ch, data|
|
70
73
|
if data.match pass_prompt
|
71
|
-
abort "Please set sudo password by using SUDO_PASSWORD or ASK_SUDO_PASSWORD environment variable" if SpecInfra.configuration.sudo_password.nil?
|
72
74
|
channel.send_data "#{SpecInfra.configuration.sudo_password}\n"
|
73
75
|
else
|
74
76
|
stdout_data += data
|
@@ -76,7 +78,11 @@ module SpecInfra
|
|
76
78
|
end
|
77
79
|
|
78
80
|
channel.on_extended_data do |ch, type, data|
|
79
|
-
|
81
|
+
if data.match /^sudo: no tty present and no askpass program specified/
|
82
|
+
abort "Please set sudo password by using SUDO_PASSWORD or ASK_SUDO_PASSWORD environment variable"
|
83
|
+
else
|
84
|
+
stderr_data += data
|
85
|
+
end
|
80
86
|
end
|
81
87
|
|
82
88
|
channel.on_request("exit-status") do |ch, data|
|
data/lib/specinfra/version.rb
CHANGED