[augeas-devel] Re: Hash-like entries across multiple lines
Free Ekanayaka
free at 64studio.com
Mon Aug 25 09:22:10 UTC 2008
Hi Raphaël,
|--==> On Mon, 25 Aug 2008 10:38:30 +0200, "Raphaël Pinson" <raphink at gmail.com> said:
RP> On Mon, Aug 25, 2008 at 10:22 AM, Free Ekanayaka <free at 64studio.com> wrote:
>>Hi,
>>
>>I am working on a lens to parse /etc/dhclient.conf (you find the
>>current code below), and I would like to parse a sequence of
>>statements like:
>>
>>send fqdn.fqdn \"grosse.fugue.com.\";
>>send fqdn.encoded on;
>>
>>into a tree like:
>>
>>{ "send"
>>{ "fqdn.fqdn" = "\"grosse.fugue.com.\"" }
>>{ "fqdn.encoded" = "on" } }
>>
>>Note that the two statements could also be in different positions in
>>the file, not only one right after the other, for example:
>>
>>send fqdn.fqdn \"grosse.fugue.com.\";
>>some statement;
>>more statements at will;
>>send fqdn.encoded on;
>>
>>So the problem I am facing is how to add subnodes to a tree node which
>>was created before. I'm not sure if this is possible/acceptable..
>>
RP> No, this is not possible. It's ok though, because it will lead to a tree
RP> like
RP> /send/fqdn.fqdn = "\"grosse.fugue.com.\""
RP> /send/fqdn.encoded = "on"
RP> Xpath should allow to parse this easily (as if it was only one node) imo.
Thanks. What's Xpath? Is it the same as this one:
http://www.w3.org/TR/xpath20/
?
How is it supposed to be interfaced to augeas?
RP> Nice. This doesn't seem to support all dhclient conf options though. In my
RP> dhclient.conf, I have stuff like
RP> alias {
RP> interface "eth0";
RP> fixed-address 192.5.5.213;
RP> option subnet-mask 255.255.255.255;
RP> }
Yes, I still have to implement block-statements like the one above. By
now only one-line statements are supported.
Ciao,
Free
More information about the augeas-devel
mailing list