summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2014-12-18 12:55:57 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2014-12-18 12:55:57 -0800
commit70942df807b7d3ab595108e0622ed3d851adc04e (patch)
tree012550cbd1ceaa923d3a74c401b7f4250a1d959c
parent3569079f9831b5e14e8e46b51840f3b6a069d9eb (diff)
downloadchef-jdm/win-seg-fault.tar.gz
Removing ole_initialize/uninitializejdm/win-seg-fault
This seems to stop ruby from seg faulting on Windows
-rw-r--r--lib/chef/platform/query_helpers.rb3
-rw-r--r--lib/chef/win32/version.rb4
2 files changed, 0 insertions, 7 deletions
diff --git a/lib/chef/platform/query_helpers.rb b/lib/chef/platform/query_helpers.rb
index 334ab278d1..ff83c871fa 100644
--- a/lib/chef/platform/query_helpers.rb
+++ b/lib/chef/platform/query_helpers.rb
@@ -35,14 +35,11 @@ class Chef
# CHEF-4888: Work around ruby #2618, expected to be fixed in Ruby 2.1.0
# https://github.com/ruby/ruby/commit/588504b20f5cc880ad51827b93e571e32446e5db
# https://github.com/ruby/ruby/commit/27ed294c7134c0de582007af3c915a635a6506cd
- WIN32OLE.ole_initialize
wmi = WmiLite::Wmi.new
host = wmi.first_of('Win32_OperatingSystem')
is_server_2003 = (host['version'] && host['version'].start_with?("5.2"))
- WIN32OLE.ole_uninitialize
-
is_server_2003
end
diff --git a/lib/chef/win32/version.rb b/lib/chef/win32/version.rb
index d16bd8c12f..6a5bd35a26 100644
--- a/lib/chef/win32/version.rb
+++ b/lib/chef/win32/version.rb
@@ -126,14 +126,10 @@ class Chef
# https://github.com/ruby/ruby/commit/588504b20f5cc880ad51827b93e571e32446e5db
# https://github.com/ruby/ruby/commit/27ed294c7134c0de582007af3c915a635a6506cd
- WIN32OLE.ole_initialize
-
wmi = WmiLite::Wmi.new
os_info = wmi.first_of('Win32_OperatingSystem')
os_version = os_info['version']
- WIN32OLE.ole_uninitialize
-
# The operating system version is a string in the following form
# that can be split into components based on the '.' delimiter:
# MajorVersionNumber.MinorVersionNumber.BuildNumber