ohai 15.6.3 → 15.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ohai/plugins/filesystem.rb +12 -6
- data/lib/ohai/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: 6bbb71abc64958b4f0ff697d800c043ad2a9fc2c27b8307c8f261b5f3d6dbccd
|
4
|
+
data.tar.gz: c4cd96f186a549a998edcbbbf2f7bcead5d5863f8a06b4a2e53c0e12d025cb20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 311e06e5bd82ab679605f5ecba6de264671d033ec033a0c612e797a867278d5e4d8b1bdd00d0b61e23f576b9321d3f0609ab2677ebbf1763e50e9d330312fa19
|
7
|
+
data.tar.gz: 2a84f84836c3063c371c8f31d1456ee939114630ccd8474c8a164453c841b746eb676c17b7f482625de40f7bfe78d02e3fc26852645f47b1487261e11414e0ed
|
@@ -162,6 +162,9 @@ Ohai.plugin(:Filesystem) do
|
|
162
162
|
end
|
163
163
|
|
164
164
|
### Windows specific methods BEGINS
|
165
|
+
# Drive types
|
166
|
+
DRIVE_TYPE ||= %w{unknown no_root_dir removable local network cd ram}.freeze
|
167
|
+
|
165
168
|
# Volume encryption or decryption status
|
166
169
|
#
|
167
170
|
# @see https://docs.microsoft.com/en-us/windows/desktop/SecProv/getconversionstatus-win32-encryptablevolume#parameters
|
@@ -173,7 +176,7 @@ Ohai.plugin(:Filesystem) do
|
|
173
176
|
|
174
177
|
# Returns a Mash loaded with logical details
|
175
178
|
#
|
176
|
-
# Uses Win32_LogicalDisk and logical_properties to return
|
179
|
+
# Uses Win32_LogicalDisk and logical_properties to return general details of volumes.
|
177
180
|
#
|
178
181
|
# Returns an empty Mash in case of any WMI exception.
|
179
182
|
#
|
@@ -184,7 +187,7 @@ Ohai.plugin(:Filesystem) do
|
|
184
187
|
def logical_info
|
185
188
|
wmi = WmiLite::Wmi.new("Root\\CIMV2")
|
186
189
|
|
187
|
-
#
|
190
|
+
# TODO: We should really be parsing Win32_Volume and Win32_MountPoint.
|
188
191
|
disks = wmi.instances_of("Win32_LogicalDisk")
|
189
192
|
logical_properties(disks)
|
190
193
|
rescue WmiLite::WmiException
|
@@ -234,9 +237,9 @@ Ohai.plugin(:Filesystem) do
|
|
234
237
|
properties = Mash.new
|
235
238
|
disks.each do |disk|
|
236
239
|
property = Mash.new
|
237
|
-
# In windows the
|
240
|
+
# In windows the closest thing we have to a device is the volume name
|
238
241
|
# and the "mountpoint" is the drive letter...
|
239
|
-
device = disk["
|
242
|
+
device = disk["volumename"].to_s.downcase
|
240
243
|
mount = disk["deviceid"]
|
241
244
|
property[:kb_size] = disk["size"] ? disk["size"].to_i / 1000 : 0
|
242
245
|
property[:kb_available] = disk["freespace"].to_i / 1000
|
@@ -244,7 +247,10 @@ Ohai.plugin(:Filesystem) do
|
|
244
247
|
property[:percent_used] = (property[:kb_size] == 0 ? 0 : (property[:kb_used] * 100 / property[:kb_size]))
|
245
248
|
property[:mount] = mount
|
246
249
|
property[:fs_type] = disk["filesystem"].to_s.downcase
|
247
|
-
property[:
|
250
|
+
property[:drive_type] = disk["drivetype"].to_i
|
251
|
+
property[:drive_type_string] = DRIVE_TYPE[disk["drivetype"].to_i]
|
252
|
+
property[:drive_type_human] = disk["description"].to_s
|
253
|
+
property[:volume_name] = disk["volumename"].to_s
|
248
254
|
property[:device] = device
|
249
255
|
|
250
256
|
key = "#{device},#{mount}"
|
@@ -747,7 +753,7 @@ Ohai.plugin(:Filesystem) do
|
|
747
753
|
|
748
754
|
collect_data(:windows) do
|
749
755
|
require "wmi-lite/wmi"
|
750
|
-
|
756
|
+
require_relative "../mash"
|
751
757
|
|
752
758
|
fs = merge_info(logical_info, encryptable_info)
|
753
759
|
|
data/lib/ohai/version.rb
CHANGED
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: 15.
|
4
|
+
version: 15.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-12-
|
11
|
+
date: 2019-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: systemu
|