
Hi Stephen, On Wednesday 30 January 2008 20:54:18 Burke, S (Stephen) wrote:
[mailto:glue-wg-bounces@ogf.org] On Behalf Of Paul Millar said: for site_dn in $(ldapsearch -LLL -h lcg-bdii.cern.ch -p 2170 [...snip: nasty bash...] sed -ne 's/^GlueSiteUniqueID: \(.*\)/\1/p'; done
I think you made my point!
Could be :)
There's no way I could remember that, and I don't want to try to reinvent it every time I want to query for something - constructing ldap queries is hard enough already ...
Well, I just wanted to point out it was possible to do these sorts of queries without using a ChunkKey entry. That isn't to say we should get rid of them, only that, for these queries, they're not essential. LDAP's support for querying is pretty limited, I guess that's why most people end up using grep/sed/awk/perl/python/(...etc..)
as a subsidiary point your query is not the same as mine, although it may happen to give the same result in this case. I assume that your method could be modified to do the same though, i.e. to only chop the DN back to the SE and query that for the ForeignKey (which will have to stay in the schema anyway).
Sorry, that was my misunderstanding. I had a previous version of the script that did precisely that: chop the SEAccessProtocol DN back to find the SE, pull out the ForeignKey element and extract the SiteUniqueID from that. However, I though it would be "cleaner" to simply navigate straight up to the site-level object from the SEAccessProtocol object and extract the SiteUniqueID from there. Are there circumstances where this wouldn't work? (assuming people are publishing valid information) Cheers, Paul.