[augeas-devel] Recursive lenses, multiple nested entries : does augeas have an iterator or foreach?

Aaron Lippold lippold at gmail.com
Wed Jun 16 01:32:10 UTC 2010


Hi Brandon et all,

>From my limited time on the #auges irc I was trying to work this out. I
got some good feedback from fdrabek on the #irc and he suggested I mail
Dave and the list with the question as well.

Hope this snippet helps drive the conversation.

Thanks All,

Aaron

[14:09] == aaronlippold  [d116585a at gateway/web/freenode/ip.209.22.88.90]
has joined #augeas
[14:13] <aaronlippold> I was hoping someone could help me work out
something with the recursive lenses.
[14:13] <aaronlippold> I am working with the httpd lense and have
everything working except for working with the <Directory> entries
[14:14] <aaronlippold> I need to get to the idea of 'foreach
<directory>' ensure that 'paramater exists' and is set to 'X'
[14:15] <aaronlippold> Though I am not sure how to do a 'foreach item in
arrary' construct in augeas.
[14:15] <aaronlippold> Anyone had a simular issue?
[14:18] == lutter [~lutter at dslb-094-217-102-077.pools.arcor-ip.net]
[14:18] ==  realname : David Lutterkort
[14:18] ==  channels : #deltacloud #augeas
[14:18] ==  server   : leguin.freenode.net [Ume?, SE, EU]
[14:18] ==  account  : lutter
[14:18] == End of WHOIS
[14:32] == haraldh [~x at p578FF766.dip.t-dialin.net] has quit [Remote host
closed the connection]
[14:36] == lutter [~lutter at dslb-094-217-102-077.pools.arcor-ip.net] has
quit [Quit: Leaving.]
[14:37] <aaronlippold> Do you know if there is a way when I am using
puppet and auges not to have augeas reload each time puppet uses augeas?
[14:48] <fdrabek> aaronlippold: which programming language do you use?
[14:48] == fdrabek [~quassel at 81.19.7.207]
[14:48] ==  realname : Filip Drabek
[14:48] ==  channels : #jopr #rhq #augeas
[14:48] ==  server   : lindbohm.freenode.net [Stockholm, Sweden]
[14:48] == End of WHOIS
[14:49] <aaronlippold> fdrabek just using strait puppet content, but for
the most part I use perl
[14:51] <fdrabek> aaronlippold: this is our lens for httpd
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=blob;f=modules/plugins/
apache/src/main/resources/httpd.aug;h=0fddced5e0e0d993d1786dee1210704a16
ed84a9;hb=master
[14:52] == lutter [~lutter at dslb-094-217-102-077.pools.arcor-ip.net] has
joined #augeas
[14:52] <fdrabek> aaronlippold: you can list all <directory and all
<directory/param and check if the nr. match
[14:53] <aaronlippold> you updated dlutters lense?
[14:53] <aaronlippold> very cool, do you have a readme.txt with useage
examples
[14:53] <aaronlippold> if not I can just play with it but thought I
would ask if I could RTFM :)
[14:53] <fdrabek> no I just don't know what version of lens is in
release 0.7.1
[14:55] <fdrabek> aaronlippold: we are using java bindings, the code for
apache plugin is here
http://git.fedorahosted.org/git/?p=rhq/rhq.git;a=tree;f=modules/plugins/
apache/src;hb=master
[14:55] <aaronlippold> well the issue I face is I need to have puppet
validate that all <directory> entries in my apache conf files (
httpd.conf or other wise included ) have certine paramers set
explicitliy off.
[14:56] <aaronlippold> sounds like this update may get me there
[14:56] <aaronlippold> i was basically running into that whole last+1
issue
[14:57] <aaronlippold> in a since, given i was sure how to tell augeas
to 'iterate' though the resultset of the parent nodes with the directory
title
[14:57] <aaronlippold> if that makes since
[14:58] <fdrabek> sorry I don't know nothing about puppet .. :(
[14:59] <aaronlippold> well either way its an augeas issue, puppet just
delivers my $var to the augeas search :)
[15:00] == You have been marked as being away
[15:01] <fdrabek> you can compare the numbers of /<Directory and
/<Directory/param , problem is the <Directory can be nested in many
<IfModule>




More information about the augeas-devel mailing list