summaryrefslogtreecommitdiff
path: root/lib/chef/util
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-08-26 14:22:18 -0700
committerKartik Null Cating-Subramanian <ksubramanian@chef.io>2015-08-27 11:54:50 -0400
commit5a863dc4331799b5876edcf5fdc31666f47888d6 (patch)
treec4cb5054c7869735b64bf35859d14684703c8eba /lib/chef/util
parent652b582c1ca7ceabe57cdf6b170fe97f4d661584 (diff)
downloadchef-5a863dc4331799b5876edcf5fdc31666f47888d6.tar.gz
Convert SetVolumeMountPoint to use ffi
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/windows/volume.rb6
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