summaryrefslogtreecommitdiff
path: root/lib/ohai/plugins/azure.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ohai/plugins/azure.rb')
-rw-r--r--lib/ohai/plugins/azure.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/ohai/plugins/azure.rb b/lib/ohai/plugins/azure.rb
index c21b8ac7..008a9a21 100644
--- a/lib/ohai/plugins/azure.rb
+++ b/lib/ohai/plugins/azure.rb
@@ -73,9 +73,11 @@ Ohai.plugin(:Azure) do
end
def tcp_ip_dhcp_domain
- return unless RUBY_PLATFORM.match?(/mswin|mingw32|windows/)
+ 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")