summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-08-09 19:44:33 -0700
committerTim Smith <tsmith84@gmail.com>2020-08-09 19:44:33 -0700
commit55bcc1e5ed38e703cf21dabd06de9cadea78dbae (patch)
tree62db8a14bea61f038a1b80a3161f71031c1e0118
parentfa8fba659f58ccdeb2aa1c9d5d6f797f6a6485e5 (diff)
downloadohai-55bcc1e5ed38e703cf21dabd06de9cadea78dbae.tar.gz
Simplify constants
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--lib/ohai/plugins/solaris2/dmi.rb2
-rw-r--r--lib/ohai/plugins/solaris2/network.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/ohai/plugins/solaris2/dmi.rb b/lib/ohai/plugins/solaris2/dmi.rb
index 806dd1f6..7d98c06d 100644
--- a/lib/ohai/plugins/solaris2/dmi.rb
+++ b/lib/ohai/plugins/solaris2/dmi.rb
@@ -86,7 +86,7 @@ Ohai.plugin(:DMI) do
"SUN_OEM_EXT_MEMARRAY" => 144, # phys memory array extended info
"SUN_OEM_EXT_MEMDEVICE" => 145, # memory device extended info
"SMB_TYPE_OEM_HI" => 256, # end of OEM-specific type range
- }
+ }.freeze
# all output lines should fall within one of these patterns
header_type_line = /^ID\s+SIZE\s+TYPE/
diff --git a/lib/ohai/plugins/solaris2/network.rb b/lib/ohai/plugins/solaris2/network.rb
index d2a9e7e7..1c7ff0f1 100644
--- a/lib/ohai/plugins/solaris2/network.rb
+++ b/lib/ohai/plugins/solaris2/network.rb
@@ -54,13 +54,11 @@
# inet6 fe80::203:baff:fe17:4444/128
# Extracted from http://illumos.org/hcl/
-unless defined?(ETHERNET_ENCAPS)
- ETHERNET_ENCAPS = %w{ afe amd8111s arn atge ath bfe bge bnx bnxe ce cxgbe
+ETHERNET_ENCAPS ||= %w{ afe amd8111s arn atge ath bfe bge bnx bnxe ce cxgbe
dmfe e1000g efe elxl emlxs eri hermon hme hxge igb
iprb ipw iwh iwi iwk iwp ixgb ixgbe mwl mxfe myri10ge
nge ntxn nxge pcn platform qfe qlc ral rge rtls rtw rwd
rwn sfe tavor vr wpi xge yge aggr}.freeze
-end
Ohai.plugin(:Network) do
require_relative "../../mixin/network_helper"