summaryrefslogtreecommitdiff
path: root/spec/support/platform_helpers.rb
diff options
context:
space:
mode:
authorAdam Edwards <adamed@opscode.com>2014-05-02 09:22:40 -0700
committersersut <serdar@opscode.com>2014-05-30 13:05:47 -0700
commit771662f8edc7f8251379f3207399bbdffa2248cc (patch)
tree8467ad262dd7618b22daa4f8b3d88e3359bf550c /spec/support/platform_helpers.rb
parenta6b19c08da6365e883d38d0ed202068df16301ab (diff)
downloadchef-771662f8edc7f8251379f3207399bbdffa2248cc.tar.gz
Re-implement ruby-wmi functionality
Diffstat (limited to 'spec/support/platform_helpers.rb')
-rw-r--r--spec/support/platform_helpers.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 884893865f..37ce5a6ca7 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -27,18 +27,21 @@ def windows?
!!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
end
-require 'ruby-wmi' if windows?
+require 'chef/win32/wmi' if windows?
def windows_domain_joined?
return false unless windows?
- WMI::Win32_ComputerSystem.find(:first).PartOfDomain
+ wmi = Chef::ReservedNames::Win32::WMI.new
+ computer_system = wmi.first_of('Win32_ComputerSystem')
+ computer_system['partofdomain']
end
def windows_win2k3?
return false unless windows?
- host = WMI::Win32_OperatingSystem.find(:first)
- (host.version && host.version.start_with?("5.2"))
+ wmi = Chef::ReservedNames::Win32::WMI.new
+ host = wmi.first_of('Win32_OperatingSystem')
+ (host['version'] && host['version'].start_with?("5.2"))
end
def mac_osx_106?