train-core 3.3.24 → 3.3.27

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: 2b4cd9dbab0f4f3706d077a9c26185998bbdc4925ef03783b90c9244e268990d
4
- data.tar.gz: a13777cd6b9e682fae479da36147ef17cbf01cf09c2d70f3377bf916e021be0f
3
+ metadata.gz: 73c36e29da576607716f40e56d269c20dc0f340eb6db173401920d31780b0795
4
+ data.tar.gz: 7dc1d05255dfe2ee94ce9c485a17542128c23981f806a2f232ec7c4e748055d0
5
5
  SHA512:
6
- metadata.gz: 36d220f296af3ac7d239a38726c0ccf6764ff171ea73004ea700c637b05233132e79619ea05de4fedbc098493baef6ea1095126325fd988475cf4a0a05ccce66
7
- data.tar.gz: 6f8b09680a850f138c217bbfc03ae18e44a117d08842d8ca00a7055931a39e95e3be3652a851a4904171f7a80e58776cf1ff2220affaa19833c495d28e10cbe7
6
+ metadata.gz: 0c93f29190920583a17b6a03f07fdd082802ce6e4a3f1d991a2e20a31a186527c487e168cb99aab77a973f648603456eb4932d02a21bdf08ab915bfc2e0f5af6
7
+ data.tar.gz: 3037542a3872731085cd7b859d79a400038ba1f5091c0433ee40fd3d3c4298b5db9d9682b4c5b60bf3c9ed94bcadeeff0a5d9e441e7dba13f7856a622cee9a33
@@ -33,15 +33,20 @@ module Train::Platforms::Detect::Helpers
33
33
  command = @backend.run_command(
34
34
  "Get-WmiObject Win32_OperatingSystem | Select Caption,Version | ConvertTo-Json"
35
35
  )
36
- return false if (command.exit_status != 0) || command.stdout.empty?
37
-
38
- payload = JSON.parse(command.stdout)
39
- @platform[:family] = "windows"
40
- @platform[:release] = payload["Version"]
41
- @platform[:name] = payload["Caption"]
42
-
43
- read_wmic
44
- true
36
+ # some targets (e.g. Cisco) may return 0 and print an error to stdout
37
+ return false if (command.exit_status != 0) || command.stdout.downcase !~ /window/
38
+
39
+ begin
40
+ payload = JSON.parse(command.stdout)
41
+ @platform[:family] = "windows"
42
+ @platform[:release] = payload["Version"]
43
+ @platform[:name] = payload["Caption"]
44
+
45
+ read_wmic
46
+ true
47
+ rescue
48
+ false
49
+ end
45
50
  end
46
51
 
47
52
  def local_windows?
@@ -126,7 +131,7 @@ module Train::Platforms::Detect::Helpers
126
131
  return if !file.exist? || file.size == 0
127
132
 
128
133
  json = JSON.parse(file.content)
129
- json["node_uuid"] if json["node_uuid"]
134
+ json["node_uuid"]
130
135
  end
131
136
 
132
137
  def windows_uuid_from_wmic
@@ -2,5 +2,5 @@
2
2
  # Author:: Dominik Richter (<dominik.richter@gmail.com>)
3
3
 
4
4
  module Train
5
- VERSION = "3.3.24".freeze
5
+ VERSION = "3.3.27".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.3.24
4
+ version: 3.3.27
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-09-18 00:00:00.000000000 Z
11
+ date: 2020-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable