diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-20 10:57:49 -0500 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-05-20 10:57:49 -0500 |
commit | 93f0426a0ef8daa59c697c65e82e8d022bb1e6c8 (patch) | |
tree | c98bc8e2b3d579aa76bc91d1b870fc923b35d897 /lib/chef/win32 | |
parent | 3b75fc90f71a47e7a8e37be90e8ad188c4f83cef (diff) | |
download | chef-93f0426a0ef8daa59c697c65e82e8d022bb1e6c8.tar.gz |
Don't call get_last_error for net apijdm/winnetfix
Diffstat (limited to 'lib/chef/win32')
-rw-r--r-- | lib/chef/win32/net.rb | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/lib/chef/win32/net.rb b/lib/chef/win32/net.rb index 0bb4d12bd4..1349091eb9 100644 --- a/lib/chef/win32/net.rb +++ b/lib/chef/win32/net.rb @@ -117,11 +117,7 @@ END rc = NetUserAdd(server_name, 3, buf, nil) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end end @@ -134,11 +130,7 @@ END rc = NetUserGetInfo(server_name, user_name, 3, ui3_p) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end ui3 = USER_INFO_3.new(ui3_p.read_pointer).as_ruby @@ -146,11 +138,7 @@ END rc = NetApiBufferFree(ui3_p.read_pointer) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end ui3 @@ -168,11 +156,7 @@ END rc = NetUserSetInfo(server_name, user_name, 3, buf, nil) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end end @@ -182,11 +166,7 @@ END rc = NetUserDel(server_name, user_name) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end end @@ -201,11 +181,7 @@ END rc = NetLocalGroupAddMembers(server_name, group_name, 3, buf, 1) if rc != NERR_Success - if Chef::ReservedNames::Win32::Error.get_last_error != 0 - Chef::ReservedNames::Win32::Error.raise! - else - net_api_error!(rc) - end + net_api_error!(rc) end end |