diff options
author | sersut <serdar@opscode.com> | 2013-01-18 11:52:45 -0800 |
---|---|---|
committer | sersut <serdar@opscode.com> | 2013-01-22 10:53:11 -0800 |
commit | 7c647b1c3ab1f820fdfad6c054370b2dc84816a1 (patch) | |
tree | 035a75b8ca492e205bf581486a7b762e9ecafb0e /lib/chef/platform.rb | |
parent | ef5c0a96d2ac015d98f270570a04630239bf3d43 (diff) | |
download | chef-7c647b1c3ab1f820fdfad6c054370b2dc84816a1.tar.gz |
Do the windows admin privilege check only on the windows versions that it is possible.
Diffstat (limited to 'lib/chef/platform.rb')
-rw-r--r-- | lib/chef/platform.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/chef/platform.rb b/lib/chef/platform.rb index 807eeafa6d..6e6de6004e 100644 --- a/lib/chef/platform.rb +++ b/lib/chef/platform.rb @@ -476,6 +476,15 @@ class Chef end end + def windows_server_2003? + return false unless windows? + + require 'ruby-wmi' + + host = WMI::Win32_OperatingSystem.find(:first) + (host.version && host.version.start_with?("5.2")) + end + private def explicit_provider(platform, version, resource_type) |