summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-04-16 10:13:33 +0100
committerSteve Kemp <steve@steve.org.uk>2015-04-16 10:13:33 +0100
commit413432e16343b7b41b34bfa19af86bacb0a4ee91 (patch)
treeacb513d5d4e74e882ef108185f9321b8492f03d9 /lib/custodian/protocoltest
parentdb7d4a4d460a7ee482c4a1b9d25a1d6a257042e2 (diff)
Fixed to be valid.
Due to some sloppy edits this module was not correct.
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r--lib/custodian/protocoltest/ldap.rb29
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