train-core 3.3.24 → 3.3.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/train/platforms/detect/helpers/os_windows.rb +15 -10
- data/lib/train/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73c36e29da576607716f40e56d269c20dc0f340eb6db173401920d31780b0795
|
4
|
+
data.tar.gz: 7dc1d05255dfe2ee94ce9c485a17542128c23981f806a2f232ec7c4e748055d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
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"]
|
134
|
+
json["node_uuid"]
|
130
135
|
end
|
131
136
|
|
132
137
|
def windows_uuid_from_wmic
|
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.3.
|
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-
|
11
|
+
date: 2020-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|