train-core 3.8.9 → 3.10.1
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 317ad7d2b997507f028541aeb119b6a9fee1949953f8aedbda2ab227060daa23
|
4
|
+
data.tar.gz: 9fcd8942668d778ea48d47a100bfbb8d8f080d92ab0af175df6a31aeb20124fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3281d0bce957f81b3719faec39eeb7a7c3f9ceee2ee6d5ed8d40b6e2ec8ef5f61d42d09daa6c0defdc55777465ec939c853ebf8128356f2358b31f2181641050
|
7
|
+
data.tar.gz: 00caa3224bd23688c46c01f2e4e6ea2591fa25c04938e95d9bdb9d1fc2d8bf3758c01362bcbdcf6dcda8633f02c89d66157e92ebb8a98462a42f94f72e1630b6
|
@@ -97,6 +97,12 @@ module Train::Platforms::Detect::Helpers
|
|
97
97
|
return @cache[:cisco] = { version: m[2], model: m[1], type: "ios-xe" }
|
98
98
|
end
|
99
99
|
|
100
|
+
# CSR 1000V (for example) does not specify model
|
101
|
+
m = res.match(/Cisco IOS XE Software, Version (\d+\.\d+\.\d+[A-Z]*)/)
|
102
|
+
unless m.nil?
|
103
|
+
return @cache[:cisco] = { version: m[1], type: "ios-xe" }
|
104
|
+
end
|
105
|
+
|
100
106
|
m = res.match(/Cisco Nexus Operating System \(NX-OS\) Software/)
|
101
107
|
unless m.nil?
|
102
108
|
v = res[/^\s*system:\s+version (\d+\.\d+)/, 1]
|
@@ -51,7 +51,7 @@ module Train::Platforms::Detect::Helpers
|
|
51
51
|
|
52
52
|
def local_windows?
|
53
53
|
@backend.class.to_s == "Train::Transports::Local::Connection" &&
|
54
|
-
ruby_host_os(/mswin|
|
54
|
+
ruby_host_os(/mswin|mingw|windows/)
|
55
55
|
end
|
56
56
|
|
57
57
|
# reads os name and version from wmic
|
@@ -326,7 +326,16 @@ class Train::Transports::SSH
|
|
326
326
|
cmd = @cmd_wrapper.run(cmd) if @cmd_wrapper
|
327
327
|
|
328
328
|
# Timeout the command if requested and able
|
329
|
-
|
329
|
+
if timeout && timeoutable?(cmd)
|
330
|
+
# if cmd start with sudo then we need to make sure the timeout should be prepend with sudo else actual timeout is not working.
|
331
|
+
if cmd.strip.split[0] == "sudo"
|
332
|
+
split_cmd = cmd.strip.split
|
333
|
+
split_cmd[0] = "sudo timeout #{timeout}s"
|
334
|
+
cmd = split_cmd.join(" ")
|
335
|
+
else
|
336
|
+
cmd = "timeout #{timeout}s #{cmd}"
|
337
|
+
end
|
338
|
+
end
|
330
339
|
|
331
340
|
logger.debug("[SSH] #{self} cmd = #{cmd}")
|
332
341
|
|
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.
|
4
|
+
version: 3.10.1
|
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: 2022-
|
11
|
+
date: 2022-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -181,7 +181,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
181
181
|
requirements:
|
182
182
|
- - ">="
|
183
183
|
- !ruby/object:Gem::Version
|
184
|
-
version: '2.
|
184
|
+
version: '2.7'
|
185
185
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
186
186
|
requirements:
|
187
187
|
- - ">="
|