summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCrae <john.mccrae@progress.com>2022-04-06 11:56:28 -0700
committerJohn McCrae <john.mccrae@progress.com>2022-04-06 11:56:28 -0700
commitac1b3f111cf3da1d3a0f17a1e04185706f840e23 (patch)
tree43c917a014cd9e67f7cd9e6e70197c6342b7a45a
parenta9883654d5033f3d732d0d45c1a9ffda06488d30 (diff)
downloadohai-ac1b3f111cf3da1d3a0f17a1e04185706f840e23.tar.gz
Updating for Ruby 3.1
Signed-off-by: John McCrae <john.mccrae@progress.com>
-rw-r--r--lib/ohai/plugins/azure.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ohai/plugins/azure.rb b/lib/ohai/plugins/azure.rb
index ef1d69f5..008a9a21 100644
--- a/lib/ohai/plugins/azure.rb
+++ b/lib/ohai/plugins/azure.rb
@@ -75,7 +75,9 @@ Ohai.plugin(:Azure) do
def tcp_ip_dhcp_domain
return unless RUBY_PLATFORM.match?(/mswin|mingw|windows/)
- require "win32/registry" unless defined?(Win32::Registry)
+ if ChefUtils.windows?
+ require "win32/registry" unless defined?(Win32::Registry)
+ end
begin
key = Win32::Registry::HKEY_LOCAL_MACHINE.open("SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters")