I’m not an expert in ruby or this library, but the result of 

 ldap = ASF::Person.list.map(&:id)

is an empty array if LDAP isn’t reachable. Does map work on nil?

> On Nov 23, 2015, at 2:32 PM, Sam Ruby <[email protected]> wrote:
> 
> On Mon, Nov 23, 2015 at 4:57 PM, Craig L Russell
> <[email protected]> wrote:
>> If the script is unable to contact the LDAP server, this line fails silently:
>> 
>>  ldap = ASF::Person.list.map(&:id)
>> 
>> Maybe it’s supposed to. What does it return if the server is unreachable? An 
>> empty array? Doesn’t seem to return an exception.
> 
> If the server is unreachable, "ASF.ldap" should be nil, so perhaps
> something like this at the top of the script may be useful:
> 
>  ldap_down = ASF.ldap.nil?

Right. Maybe in addition to ignoring the LDAP checks there should be a warning 
message at the top of the web page. 
> 
>> If it’s empty, every line shows as “not in LDAP’.
>> 
>> I’ll see if I can skip the ldap check if the ldap array has no elements.
> 
> Might also be worth adding some text to the top or bottom of the
> output so to indicate that there was a problem accessing the LDAP
> server.
> 
>> Craig
>> 
>> Craig L Russell
>> Architect, Oracle
>> http://db.apache.org/jdo
>> 408 276-5638 mailto:[email protected]
>> P.S. A good JDO? O, Gasp!
> 
> - Sam Ruby
> 
> P.S.  Do you have some local changes that can be committed?  I see a
> lot of "Your Apache ICLA has gone missing" messages went out…

I’ve committed all of my changes, including the “ignore LDAP checks if ldap is 
empty.

Craig L Russell
Architect, Oracle
http://db.apache.org/jdo
408 276-5638 mailto:[email protected]
P.S. A good JDO? O, Gasp!

Reply via email to