diff options
author | Serdar Sutay <serdar@opscode.com> | 2014-06-24 13:33:00 -0700 |
---|---|---|
committer | Serdar Sutay <serdar@opscode.com> | 2014-06-24 13:33:00 -0700 |
commit | 12eca18c3e3865fa1cf379d0e4cd4f2b14fc055c (patch) | |
tree | 15a1d3cf10fd730a2af68774fe2415873c7aad2b | |
parent | 9f42beea1883f345bdc4697d074ec93611a1b796 (diff) | |
parent | 202240a2d3db468a00d12de4edcf10a57629374d (diff) | |
download | chef-12eca18c3e3865fa1cf379d0e4cd4f2b14fc055c.tar.gz |
Merge pull request #1528 from opscode/sersut/bump-ffi-version
Bump ffi version since chef-dk depends on chef and dep-selector and dep-selector uses ~> 1.9.
-rw-r--r-- | chef-x86-mingw32.gemspec | 2 | ||||
-rw-r--r-- | lib/chef/win32/error.rb | 2 | ||||
-rw-r--r-- | lib/chef/win32/security.rb | 10 | ||||
-rw-r--r-- | spec/functional/application_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/provider/mount/solaris_spec.rb | 4 |
5 files changed, 12 insertions, 10 deletions
diff --git a/chef-x86-mingw32.gemspec b/chef-x86-mingw32.gemspec index e34724ae51..6d69c4e7e6 100644 --- a/chef-x86-mingw32.gemspec +++ b/chef-x86-mingw32.gemspec @@ -3,7 +3,7 @@ gemspec = eval(IO.read(File.expand_path("../chef.gemspec", __FILE__))) gemspec.platform = "x86-mingw32" -gemspec.add_dependency "ffi", "1.5.0" +gemspec.add_dependency "ffi", "~> 1.9" gemspec.add_dependency "windows-api", "0.4.2" gemspec.add_dependency "windows-pr", "1.2.2" gemspec.add_dependency "win32-api", "1.5.1" diff --git a/lib/chef/win32/error.rb b/lib/chef/win32/error.rb index 716ca99d01..2175608eeb 100644 --- a/lib/chef/win32/error.rb +++ b/lib/chef/win32/error.rb @@ -47,7 +47,7 @@ class Chef end def self.get_last_error - GetLastError() + FFI::LastError.error end # Raises the last error. This should only be called by diff --git a/lib/chef/win32/security.rb b/lib/chef/win32/security.rb index ff97c465e5..48ca78647f 100644 --- a/lib/chef/win32/security.rb +++ b/lib/chef/win32/security.rb @@ -262,7 +262,7 @@ class Chef system_name = system_name.to_wstring if system_name if LookupAccountNameW(system_name, name.to_wstring, nil, sid_size, nil, referenced_domain_name_size, nil) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -284,7 +284,7 @@ class Chef system_name = system_name.to_wstring if system_name if LookupAccountSidW(system_name, sid, nil, name_size, nil, referenced_domain_name_size, nil) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupAccountSid, and got no error!" - elsif Chef::ReservedNames::Win32::Error::get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -303,7 +303,7 @@ class Chef name_size = FFI::Buffer.new(:long).write_long(0) if LookupPrivilegeNameW(system_name, luid, nil, name_size) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -321,7 +321,7 @@ class Chef language_id = FFI::Buffer.new(:long) if LookupPrivilegeDisplayNameW(system_name, name.to_wstring, nil, display_name_size, language_id) raise "Expected ERROR_INSUFFICIENT_BUFFER from LookupPrivilegeDisplayName, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end @@ -353,7 +353,7 @@ class Chef group_size = FFI::Buffer.new(:long).write_long(0) if MakeAbsoluteSD(security_descriptor, nil, absolute_sd_size, nil, dacl_size, nil, sacl_size, nil, owner_size, nil, group_size) raise "Expected ERROR_INSUFFICIENT_BUFFER from MakeAbsoluteSD, and got no error!" - elsif Chef::ReservedNames::Win32::Error.get_last_error != ERROR_INSUFFICIENT_BUFFER + elsif FFI::LastError.error != ERROR_INSUFFICIENT_BUFFER Chef::ReservedNames::Win32::Error.raise! end diff --git a/spec/functional/application_spec.rb b/spec/functional/application_spec.rb index 297f1c3797..4a0fdff8f8 100644 --- a/spec/functional/application_spec.rb +++ b/spec/functional/application_spec.rb @@ -47,12 +47,12 @@ describe Chef::Application do it "saves built proxy to ENV which shell_out can use" do so = if windows? - shell_out("echo $env:http_proxy") + shell_out("echo %http_proxy%") else shell_out("echo $http_proxy") end - so.stdout.should == "http://proxy.example.org:8080\n" + so.stdout.chomp.should == "http://proxy.example.org:8080" end end end diff --git a/spec/unit/provider/mount/solaris_spec.rb b/spec/unit/provider/mount/solaris_spec.rb index e7dd17c746..5d328c2edc 100644 --- a/spec/unit/provider/mount/solaris_spec.rb +++ b/spec/unit/provider/mount/solaris_spec.rb @@ -19,7 +19,9 @@ require 'spec_helper' require 'ostruct' -describe Chef::Provider::Mount::Solaris do +# Do not run these tests on windows because some path handling +# code is not implemented to handle windows paths. +describe Chef::Provider::Mount::Solaris, :unix_only do let(:node) { Chef::Node.new } let(:events) { Chef::EventDispatch::Dispatcher.new } |