diff options
author | Tim Smith <tsmith@chef.io> | 2020-04-25 09:54:17 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-25 09:54:17 -0700 |
commit | 97d71e18475730c9e0085d65b980710b46ea53dc (patch) | |
tree | 666739ecf10ac7bd9d607b1da12e0ea7e94b3cd6 | |
parent | d8ab39bbf318bf9ceb25e188fff795a827097564 (diff) | |
parent | 787946a4850a558e01623a07e1173b1672b551c4 (diff) | |
download | ohai-97d71e18475730c9e0085d65b980710b46ea53dc.tar.gz |
Merge pull request #1456 from chef/constants
Avoid constant warnings when reloading ohai plugins
-rw-r--r-- | lib/ohai/plugins/windows/dmi.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ohai/plugins/windows/dmi.rb b/lib/ohai/plugins/windows/dmi.rb index 6d3637c1..eea5b37f 100644 --- a/lib/ohai/plugins/windows/dmi.rb +++ b/lib/ohai/plugins/windows/dmi.rb @@ -20,7 +20,7 @@ Ohai.plugin(:DMI) do provides "dmi" # Map the linux component types to their rough Windows API equivalents - DMI_TO_WIN32OLE = { + DMI_TO_WIN32OLE ||= { chassis: "SystemEnclosure", processor: "Processor", bios: "Bios", @@ -36,9 +36,9 @@ Ohai.plugin(:DMI) do # # This cannot handle some property names, eg SMBIOSBIOSVersion. # https://rubular.com/r/FBNtXod4wkZGAG - SPLIT_REGEX = /[A-Z][a-z0-9]+|[A-Z]{2,}(?=[A-Z][a-z0-9])|[A-Z]{2,}/.freeze + SPLIT_REGEX ||= /[A-Z][a-z0-9]+|[A-Z]{2,}(?=[A-Z][a-z0-9])|[A-Z]{2,}/.freeze - WINDOWS_TO_UNIX_KEYS = [ + WINDOWS_TO_UNIX_KEYS ||= [ %w{vendor manufacturer}, %w{identifying_number serial_number}, %w{name family}, |