train-core 3.2.22 → 3.2.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/train/extras/command_wrapper.rb +6 -7
- data/lib/train/file/remote/unix.rb +8 -2
- data/lib/train/transports/ssh_connection.rb +1 -1
- data/lib/train/version.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67c0010a7ddc9d245cfa156fee62ec62a666e781517cb8fefa255ad91782a72f
|
4
|
+
data.tar.gz: 90ebeee368d746e51c7c1d1b1d415aed70560e0175690ca47fc14fcde853b71a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 555cc40edf25a6a6a745e64f65f5bc95419e0a7d267932044f6cec8c3911675e6035f202b913b688bb381d60912a1838523df4cfe781699d3913a486d5f32b1e
|
7
|
+
data.tar.gz: 848799176b28a076141ee65a011ae8fa1fcdafbaa713074ac66c40055e77d2f0cb4a57ffe900c0a066cbda2271e322af61323cc3c5a3f74bb63e8919cc44cd01
|
@@ -55,11 +55,10 @@ module Train::Extras
|
|
55
55
|
|
56
56
|
# (see CommandWrapperBase::verify)
|
57
57
|
def verify
|
58
|
+
# Do nothing, successfully. Don't use "true", that's not available on Windows.
|
58
59
|
cmd = if @sudo
|
59
60
|
# Wrap it up. It needs /dev/null on the outside to disable stdin
|
60
|
-
|
61
|
-
# See test-kitchen's use of this variable for conflict.
|
62
|
-
"sh -c '(sudo -v) < /dev/null'"
|
61
|
+
"sh -c '(#{run("echo")}) < /dev/null'"
|
63
62
|
else
|
64
63
|
run("echo")
|
65
64
|
end
|
@@ -73,14 +72,14 @@ module Train::Extras
|
|
73
72
|
rawerr = "#{res.stdout} #{res.stderr}".strip
|
74
73
|
|
75
74
|
case rawerr
|
76
|
-
when
|
75
|
+
when /Sorry, try again/
|
77
76
|
["Wrong sudo password.", :bad_sudo_password]
|
78
|
-
when
|
77
|
+
when /sudo: no tty present and no askpass program specified/
|
79
78
|
["Sudo requires a password, please configure it.", :sudo_password_required]
|
80
|
-
when
|
79
|
+
when /sudo: command not found/
|
81
80
|
["Can't find sudo command. Please either install and "\
|
82
81
|
"configure it on the target or deactivate sudo.", :sudo_command_not_found]
|
83
|
-
when
|
82
|
+
when /sudo: sorry, you must have a tty to run sudo/
|
84
83
|
["Sudo requires a TTY. Please see the README on how to configure "\
|
85
84
|
"sudo to allow for non-interactive usage.", :sudo_no_tty]
|
86
85
|
else
|
@@ -22,8 +22,14 @@ module Train
|
|
22
22
|
def exist?
|
23
23
|
@exist ||= begin
|
24
24
|
f = @follow_symlink ? "" : " || test -L #{@spath}"
|
25
|
-
@backend.
|
26
|
-
|
25
|
+
if @backend.platform.solaris?
|
26
|
+
# Solaris does not support `-e` flag in default `test`,
|
27
|
+
# so we specify by running /usr/bin/test:
|
28
|
+
# https://github.com/inspec/train/issues/587
|
29
|
+
@backend.run_command("/usr/bin/test -e #{@spath}" + f)
|
30
|
+
else
|
31
|
+
@backend.run_command("test -e #{@spath}" + f)
|
32
|
+
end.exit_status == 0
|
27
33
|
end
|
28
34
|
end
|
29
35
|
|
@@ -54,7 +54,7 @@ class Train::Transports::SSH
|
|
54
54
|
@bastion_user = @options.delete(:bastion_user)
|
55
55
|
@bastion_port = @options.delete(:bastion_port)
|
56
56
|
|
57
|
-
@cmd_wrapper
|
57
|
+
@cmd_wrapper = CommandWrapper.load(self, @transport_options)
|
58
58
|
end
|
59
59
|
|
60
60
|
# (see Base::Connection#close)
|
data/lib/train/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: train-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef InSpec Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -25,19 +25,19 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: ffi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '1.13'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "<"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.13'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: json
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '1.2'
|
88
88
|
- - "<"
|
89
89
|
- !ruby/object:Gem::Version
|
90
|
-
version: '
|
90
|
+
version: '4.0'
|
91
91
|
type: :runtime
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -97,7 +97,7 @@ dependencies:
|
|
97
97
|
version: '1.2'
|
98
98
|
- - "<"
|
99
99
|
- !ruby/object:Gem::Version
|
100
|
-
version: '
|
100
|
+
version: '4.0'
|
101
101
|
- !ruby/object:Gem::Dependency
|
102
102
|
name: net-ssh
|
103
103
|
requirement: !ruby/object:Gem::Requirement
|