summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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")