summaryrefslogtreecommitdiff
path: root/lib/chef/util/windows/net_user.rb
diff options
context:
space:
mode:
authorBryan McLellan <btm@loftninjas.org>2014-08-22 16:49:33 -0400
committerBryan McLellan <btm@loftninjas.org>2014-08-22 19:07:24 -0400
commite73219cdcc51866ddac2a82c810bda8c8046d743 (patch)
tree6aa4b0a1547d10c86471f6bd4bd5972055c864b2 /lib/chef/util/windows/net_user.rb
parentec0ff9515757443b07a50a412a0a9b70a68de689 (diff)
downloadchef-e73219cdcc51866ddac2a82c810bda8c8046d743.tar.gz
unpack the conditionals a little for readability
Diffstat (limited to 'lib/chef/util/windows/net_user.rb')
-rw-r--r--lib/chef/util/windows/net_user.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/chef/util/windows/net_user.rb b/lib/chef/util/windows/net_user.rb
index 808352292e..5df1a8aaa4 100644
--- a/lib/chef/util/windows/net_user.rb
+++ b/lib/chef/util/windows/net_user.rb
@@ -138,8 +138,11 @@ class Chef::Util::Windows::NetUser < Chef::Util::Windows
ptr = 0.chr * PTR_SIZE
rc = NetUserGetInfo.call(nil, @name, 3, ptr)
- raise Chef::Exceptions::UserIDNotFound, get_last_error(rc) if rc == NERR_UserNotFound
- raise ArgumentError, get_last_error(rc) if rc != NERR_Success
+ if rc == NERR_UserNotFound
+ raise Chef::Exceptions::UserIDNotFound, get_last_error(rc)
+ elsif rc != NERR_Success
+ raise ArgumentError, get_last_error(rc)
+ end
ptr = ptr.unpack('L')[0]
buffer = 0.chr * SIZEOF_USER_INFO_3