diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-08-26 14:22:18 -0700 |
---|---|---|
committer | Kartik Null Cating-Subramanian <ksubramanian@chef.io> | 2015-08-27 11:54:50 -0400 |
commit | 5a863dc4331799b5876edcf5fdc31666f47888d6 (patch) | |
tree | c4cb5054c7869735b64bf35859d14684703c8eba /lib/chef/util/windows | |
parent | 652b582c1ca7ceabe57cdf6b170fe97f4d661584 (diff) | |
download | chef-5a863dc4331799b5876edcf5fdc31666f47888d6.tar.gz |
Convert SetVolumeMountPoint to use ffi
Diffstat (limited to 'lib/chef/util/windows')
-rw-r--r-- | lib/chef/util/windows/volume.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/chef/util/windows/volume.rb b/lib/chef/util/windows/volume.rb index 15780d61a1..e28a5091ac 100644 --- a/lib/chef/util/windows/volume.rb +++ b/lib/chef/util/windows/volume.rb @@ -52,8 +52,10 @@ class Chef::Util::Windows::Volume < Chef::Util::Windows end def add(args) - unless SetVolumeMountPoint(@name, args[:remote]) - raise ArgumentError, get_last_error + begin + Chef::ReservedNames::Win32::File.set_volume_mount_point(@name, args[:remote]) + rescue Chef::Exceptions::Win32APIError => e + raise ArgumentError, e end end end |