From a63e77193e1e49700e9d92d984431d27a31609c2 Mon Sep 17 00:00:00 2001 From: Steve Kemp Date: Wed, 13 Feb 2013 11:00:49 +0000 Subject: Fixed syntax --- lib/custodian/protocoltest/ldap.rb | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'lib/custodian') 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 -- cgit v1.2.1