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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 257f27a9e93bbd45470aa2e42c2a9e1e503e8d2e6568a5cbca4d8d964724e854
4
- data.tar.gz: aa10fc60bdf94170e7d14f9bf38278974baf68995869c7a9467f45081d193e61
3
+ metadata.gz: 6bbb71abc64958b4f0ff697d800c043ad2a9fc2c27b8307c8f261b5f3d6dbccd
4
+ data.tar.gz: c4cd96f186a549a998edcbbbf2f7bcead5d5863f8a06b4a2e53c0e12d025cb20
5
5
  SHA512:
6
- metadata.gz: 2595eef2b22bcafea6af89415c1ab6566036badb6b8ffba253be3ada2529632ad8210201d38bd5b56d2087cb5b2f2f513479a77ba8e0af5385ade1c250ae50dc
7
- data.tar.gz: 4b8c0e3daa5eda327ce6f48f4c7ed34f7e045262e68a3f99c7e78667cc00f15ec4674c37efe4f134c71768841635739cfef06814b598c435cf70cd0d4058ffdb
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 encryption details of volumes.
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
- # Note: we should really be parsing Win32_Volume and Win32_Mapped drive.
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 closet thing we have to a device is the volume_name
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["volume_name"].to_s.downcase
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[:volume_name] = device
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
- require "ohai/mash"
756
+ require_relative "../mash"
751
757
 
752
758
  fs = merge_info(logical_info, encryptable_info)
753
759
 
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Ohai
20
20
  OHAI_ROOT = File.expand_path(File.dirname(__FILE__))
21
- VERSION = "15.6.3".freeze
21
+ VERSION = "15.7.3".freeze
22
22
  end
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.6.3
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-06 00:00:00.000000000 Z
11
+ date: 2019-12-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu