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 | 1bf51690d4aa57f36907234fceabb90ad7810bc9 (patch) | |
tree | 4473b6efa1af6554d1db95f519c5bc9e4dbcf50d | |
parent | aff29c0585d499d6cf9ad57080a928cda8d36b7e (diff) |
Fixed to be valid.
Due to some sloppy edits this module was not correct.
-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 |