diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-04-16 10:13:33 +0100 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-04-16 10:13:33 +0100 |
commit | 413432e16343b7b41b34bfa19af86bacb0a4ee91 (patch) | |
tree | acb513d5d4e74e882ef108185f9321b8492f03d9 /lib | |
parent | db7d4a4d460a7ee482c4a1b9d25a1d6a257042e2 (diff) |
Fixed to be valid.
Due to some sloppy edits this module was not correct.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/custodian/protocoltest/ldap.rb | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb index baabd7f..4509ee0 100644 --- a/lib/custodian/protocoltest/ldap.rb +++ b/lib/custodian/protocoltest/ldap.rb @@ -126,27 +126,26 @@ module Custodian @error = "failed to bind to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" return false end + rescue LDAP::ResultError => ex + @error = "LDAP exception: #{ex} when talking to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" + return false end - rescue LDAP::ResultError => ex - @error = "LDAP exception: #{ex} when talking to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" - return false - end - - @error = "LDAP server test failed against '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" - false - end + @error = "LDAP server test failed against '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" + false + end - # - # If the test fails then report the error. - # - def error - @error - end + # + # If the test fails then report the error. + # + def error + @error + end - register_test_type 'ldap' + register_test_type 'ldap' + end end end |