summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2018-02-28 11:40:19 -0800
committerTim Smith <tsmith@chef.io>2018-02-28 11:40:19 -0800
commit3b182df271ecaacbdaf70a3c36b026f4102d3af5 (patch)
tree238fda1ea99d1cb0d08f5d30f46dd59003038f9a
parenta3de6fdea41ce24c3152404eecdfead041c38da0 (diff)
downloadohai-3b182df271ecaacbdaf70a3c36b026f4102d3af5.tar.gz
Skip the WMI class names on network adapters as well
Another .2k on a standard node Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/windows/network.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ohai/plugins/windows/network.rb b/lib/ohai/plugins/windows/network.rb
index ae52d215..9a80ec88 100644
--- a/lib/ohai/plugins/windows/network.rb
+++ b/lib/ohai/plugins/windows/network.rb
@@ -36,7 +36,7 @@ Ohai.plugin(:Network) do
wmi = WmiLite::Wmi.new
data[:addresses] = wmi.instances_of("Win32_NetworkAdapterConfiguration")
- # If we are running on windows nano or anothe roperating system from the future
+ # If we are running on windows nano or another operating system from the future
# that does not populate the deprecated win32_* WMI classes, then we should
# grab data from the newer MSFT_* classes
return msft_adapter_data if data[:addresses].count == 0
@@ -81,6 +81,8 @@ Ohai.plugin(:Network) do
i = adapter["index"] || adapter["InterfaceIndex"]
iface_instance[i] = Mash.new
adapter.wmi_ole_object.properties_.each do |p|
+ # skip wmi class name fields which make no sense in ohai
+ next if %w{creation_class_name system_creation_class_name}.include?(p.name.wmi_underscore)
iface_instance[i][p.name.wmi_underscore.to_sym] = adapter[p.name.downcase]
end
end