ohai 8.17.0 → 8.17.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 +4 -4
- data/Gemfile +4 -2
- data/lib/ohai/plugins/powershell.rb +23 -7
- data/lib/ohai/plugins/timezone.rb +3 -2
- data/lib/ohai/version.rb +1 -1
- data/spec/unit/plugins/powershell_spec.rb +2 -0
- data/spec/unit/plugins/timezone_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b474815c9a67658b2190cad18967511a48593d4
|
|
4
|
+
data.tar.gz: 268d26318d08819041eb136cb06dff59a15cab5e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a7d729b4dab3483ab3d08ed0e383503a7720ef3bad30b0395c44a1c00419531db582f7d9e9fdb6f6d93ac40049da37fbcbde3fb1bae666b2368187e7aeba980
|
|
7
|
+
data.tar.gz: 8dfa9640dcf754831ebf088fa544e81d9de823a1b5dc9040f4d1fd2c34ce358d3dab20f5cfa758d319d7132185a31e2718cee7f34638cac7a41cd90cdf91cdbd
|
data/Gemfile
CHANGED
|
@@ -46,7 +46,7 @@ Ohai.plugin(:Powershell) do
|
|
|
46
46
|
powershell[:serialization_version] = version_info["SerializationVersion"]
|
|
47
47
|
powershell[:clr_version] = version_info["CLRVersion"]
|
|
48
48
|
powershell[:build_version] = version_info["BuildVersion"]
|
|
49
|
-
powershell[:compatible_versions] = parse_compatible_versions
|
|
49
|
+
powershell[:compatible_versions] = parse_compatible_versions
|
|
50
50
|
powershell[:remoting_protocol_version] = version_info["PSRemotingProtocolVersion"]
|
|
51
51
|
languages[:powershell] = powershell unless powershell.empty?
|
|
52
52
|
end
|
|
@@ -55,12 +55,28 @@ Ohai.plugin(:Powershell) do
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
def version_command
|
|
59
|
+
[
|
|
60
|
+
"$progresspreference = 'silentlycontinue'",
|
|
61
|
+
"$PSVersionTable.PSCompatibleVersions | foreach {$_.tostring()}",
|
|
62
|
+
].join("; ")
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def powershell_command
|
|
66
|
+
["powershell.exe",
|
|
67
|
+
"-NoLogo",
|
|
68
|
+
"-NonInteractive",
|
|
69
|
+
"-NoProfile",
|
|
70
|
+
"-Command",
|
|
71
|
+
].join(" ")
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def parse_compatible_versions
|
|
75
|
+
so = shell_out("#{powershell_command} \"#{version_command}\"")
|
|
76
|
+
versions = []
|
|
77
|
+
so.stdout.strip.each_line do |line|
|
|
78
|
+
versions << line.strip
|
|
64
79
|
end
|
|
80
|
+
versions
|
|
65
81
|
end
|
|
66
82
|
end
|
|
@@ -15,9 +15,10 @@
|
|
|
15
15
|
# limitations under the License.
|
|
16
16
|
|
|
17
17
|
Ohai.plugin(:Timezone) do
|
|
18
|
-
provides "timezone"
|
|
18
|
+
provides "time/timezone"
|
|
19
19
|
|
|
20
20
|
collect_data(:default) do
|
|
21
|
-
|
|
21
|
+
time Mash.new unless time
|
|
22
|
+
time[:timezone] = Time.now.getlocal.zone
|
|
22
23
|
end
|
|
23
24
|
end
|
data/lib/ohai/version.rb
CHANGED
|
@@ -43,8 +43,10 @@ PSCompatibleVersions {1.0, 2.0, 3.0, 4.0}
|
|
|
43
43
|
PSRemotingProtocolVersion 2.2
|
|
44
44
|
|
|
45
45
|
END
|
|
46
|
+
compat_version_array = ["1.0", "2.0", "3.0", "4.0"]
|
|
46
47
|
|
|
47
48
|
allow(plugin).to receive(:shell_out).with(anything()).and_return(mock_shell_out(0, v4_output, ""))
|
|
49
|
+
allow(plugin).to receive(:parse_compatible_versions).and_return(compat_version_array)
|
|
48
50
|
plugin.run
|
|
49
51
|
expect(plugin.languages[:powershell][:version]).to eql("4.0")
|
|
50
52
|
expect(plugin.languages[:powershell][:ws_man_stack_version]).to eql("3.0")
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ohai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 8.17.
|
|
4
|
+
version: 8.17.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Jacob
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-06-
|
|
11
|
+
date: 2016-06-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: systemu
|