train-core 3.8.9 → 3.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: edb9b675408e81e6b24133e0fa0a859d19f727091fda4a93a7b16691addb20cf
4
- data.tar.gz: 628ff896313d2ad8113a01c018864840fc341f2239246c85e8d2c47a921354fb
3
+ metadata.gz: 317ad7d2b997507f028541aeb119b6a9fee1949953f8aedbda2ab227060daa23
4
+ data.tar.gz: 9fcd8942668d778ea48d47a100bfbb8d8f080d92ab0af175df6a31aeb20124fc
5
5
  SHA512:
6
- metadata.gz: d37f24464d367c55bfa73f285804b2428203219452a04d58bab4623adff91bc834ea4e27a1a1eb67aa813b3ab99ea4a16cecbe805dd92125e5f8df3e4308862f
7
- data.tar.gz: 853c5858f859944c9e5b0777191d370ed062441986af9ab86e86b532188145dd1df55a1fc0ffea4cd6113545420783f3f489eb0a8e6db50851a5a6d2ebc4765e
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|mingw32|windows/)
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
- cmd = "timeout #{timeout}s #{cmd}" if timeout && timeoutable?(cmd)
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
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.8.9".freeze
5
+ VERSION = "3.10.1".freeze
6
6
  end
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.8.9
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-03-09 00:00:00.000000000 Z
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.5'
184
+ version: '2.7'
185
185
  required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  requirements:
187
187
  - - ">="