train-core 3.8.9 → 3.9.2
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: 2d3eabbefcf1adac9f0d1142143709c390d4bac2b480ea26ab2b54b290d4c94b
|
4
|
+
data.tar.gz: dd7f3e0edf4f7c0fad07582d2bf895578b31ebd1cba881bb6e5e7b32c9f312fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91b758fd870fd5c4f32672a7e671d468fced308acc7f58754204e4e9beaa4baba6c798c25215c8112ed438ef0a5910725af4dcff1764a322d917f343af38996c
|
7
|
+
data.tar.gz: 48ccaea241788cf7d9aa7a682348781755a4e3cefcf95ae7134c8ede4b273acdc95eb2de109a5a169a00fc527364d74757c0506a98bef75cff44f786957f52c9
|
@@ -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]
|
@@ -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.9.2
|
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-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|