-
-
Save domgetter/0a22c26723f58ebb27b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin # start catching exceptions here | |
ldap = Net::LDAP.open( | |
:host => host, | |
:port => port, | |
:auth => { | |
:method => :simple, | |
:username => CONFIG['repldn'], | |
:password => CONFIG['replpw'] | |
} | |
) | |
unless ldap.bind | |
LOG.warn "connected to #{host}:#{port} but bind failed." | |
exit 3 | |
end | |
end | |
# Bind was succesful, let's use the server from now on. | |
# I want to end the exception handling block, but I'm in a nested block now | |
# How to do that without ending the block to whom ldap was yielded? | |
ldap.search() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment