<br><br><div class="gmail_quote">On Mon, May 11, 2009 at 6:45 AM, Matt Palmer <span dir="ltr"><<a href="mailto:matt@anchor.net.au">matt@anchor.net.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I think this kinda says it all, really:<br>
<br>
---8<---<br>
<br>
grog:~# augtool<br>
augtool> set /files/etc/network/interfaces/iface[4] br0<br>
augtool> set /files/etc/network/interfaces/iface[4]/method manual<br>
augtool> set /files/etc/network/interfaces/iface[4]/family inet<br>
augtool> set /files/etc/network/interfaces/iface[4]/address 192.168.12.14<br>
augtool> set /files/etc/network/interfaces/iface[4]/netmask 255.255.255.0<br>
augtool> save<br>
Saving failed<br>
augtool>  ls /augeas/files/etc/network/interfaces/error/<br>
path = /files/etc/network/interfaces/iface<br>
lens = /usr/share/augeas/lenses/dist/interfaces.aug:77.16-81.46<br>
message = Failed to match /(family/)(method/)((((allow-[a-z-][a-z-][a-z-]*_[_a-z-]*|allow-[a-z-]_[_a-z-]*|allow-(_[_a-z-]*|)|allow([_a-z][_a-z-]*|)|allo([_a-vx-z-][_a-z-]*|)|all([_a-np-z-][_a-z-]*|)|auto[_a-z-][_a-z-]*|aut([_a-np-z-][_a-z-]*|)|au([_a-su-z-][_a-z-]*|)|al([_a-km-z-][_a-z-]*|)|iface[_a-z-][_a-z-]*|ifac([_a-df-z-][_a-z-]*|)|ifa([_abd-z-][_a-z-]*|)|if([_b-z-][_a-z-]*|)|mapping[_a-z-][_a-z-]*|mappin([_a-fh-z-][_a-z-]*|)|mappi([_a-mo-z-][_a-z-]*|)|mapp([_a-hj-z-][_a-z-]*|)|map([_a-oq-z-][_a-z-]*|)|ma([_a-oq-z-][_a-z-]*|)|(m[_b-z-]|i[_a-eg-z-]|a[_a-km-tv-z-]|[_b-hj-ln-z-][_a-z-])[_a-z-]*|m|i|a|[_b-hj-ln-z-])/)|(#comment/)|(/))*)/ with method/family/address/netmask/<br>

augtool> exit<br>
grog:~# augtool<br>
augtool> set /files/etc/network/interfaces/iface[4] br0<br>
augtool> set /files/etc/network/interfaces/iface[4]/family inet<br>
augtool> set /files/etc/network/interfaces/iface[4]/method manual<br>
augtool> set /files/etc/network/interfaces/iface[4]/address 192.168.12.14<br>
augtool> set /files/etc/network/interfaces/iface[4]/netmask 255.255.255.0<br>
augtool> save<br>
Saved 1 file(s)<br>
<br>
--->8---<br>
<br>
For the love of all that is holy, WHY?<br>
</blockquote><div><br><br>Because Augeas doesn't understand what the config file means, variable order is important. The format is like this :<br><br>"iface eth0 inet manual"<br><br>which is mapped as <br>{ "iface" = "eth0"<br>
       { "family" = "inet" }<br>       { "method = "manual" } }<br><br>Now imagine that this format also allows (I know it doesn't, but it could) :<br><br>"iface eth0 method=manual family=inet"<br>
<br>which would get mapped as <br><br>{ "iface" = "eth0"<br>    { "method" = "manual" }<br>    { "family"    = "inet" } }<br><br><br>While the interpretation of the config file might lead to the same results in the application using it, Augeas has no idea about that, and inverting the variables in the tree changes the config file drammatically. Again, this is not a real life example, but you can easily imagine how real life examples would work (see sudoers if you want to pull your hair with this kind of "priority matters" config parameters).<br>
<br><br><br>Raphaël<br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
--<br>
Matt Palmer - Systems Administrator<br>
<br>
A view into the Anchor Engineroom: <a href="http://anchor.com.au/blog/" target="_blank">http://anchor.com.au/blog/</a><br>
Web Hosting Knowledgebase: <a href="http://anchor.com.au/wiki/" target="_blank">http://anchor.com.au/wiki/</a><br>
<br>
Anchor Systems Pty Ltd - Hosting Heavyweights<br>
W: <a href="http://www.anchor.com.u" target="_blank">http://www.anchor.com.u</a> - E: <a href="mailto:support@anchor.com.au">support@anchor.com.au</a><br>
Phone: 1300 883 979 - Fax: 02 8296 5199<br>
<br>
<br>
_______________________________________________<br>
augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
</blockquote></div><br>