diff options
author | Steve Kemp <steve@steve.org.uk> | 2013-02-13 11:00:49 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2013-02-13 11:00:49 +0000 |
commit | d2ee5f620e6ad1cf3b2bdafd38cc218f84829a5b (patch) | |
tree | a9a145592982dfe028ad8be4b604c178f5c24888 /lib/custodian/protocoltest | |
parent | dd3df354fbadfb23f6ca3966d1f43e61fe8f1c0a (diff) |
Fixed syntax
Diffstat (limited to 'lib/custodian/protocoltest')
-rw-r--r-- | lib/custodian/protocoltest/ldap.rb | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/custodian/protocoltest/ldap.rb b/lib/custodian/protocoltest/ldap.rb index 3e849f3..9da4ce5 100644 --- a/lib/custodian/protocoltest/ldap.rb +++ b/lib/custodian/protocoltest/ldap.rb @@ -96,23 +96,17 @@ module Custodian @error = nil begin - # # Connect. - # ldap = LDAP::Conn.new( @host, @port ) ldap.set_option(LDAP::LDAP_OPT_PROTOCOL_VERSION, 3) - # # Hardwired search is bad.. - # base = 'ou=groups,dc=bytemark,dc=co,dc=uk' scope = LDAP::LDAP_SCOPE_SUBTREE filter = '(cn=vpn*)' attrs = ['sn', 'cn'] - # # Bind. - # ldap.bind( @ldap_user, @ldap_pass ) if ( ldap.bound? ) @@ -130,28 +124,30 @@ module Custodian end end rescue LDAP::ResultError => ex - @error = "LDAP exception: #{ex} when talkign to LDAP server '#{@host}' with username '#{@ldap_user}' and password '#{@ldap_pass}'" + @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}'" + return 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 +end |