[augeas-devel] How can I reverse the order of the parsed keys?

David Lutterkort lutter at redhat.com
Fri Feb 4 19:21:22 UTC 2011


On Fri, 2011-02-04 at 11:14 -0500, Owen Mann wrote:
> For me, this begs a "big picture" question: Is abstracting differences in implementation a goal of Augeas?
> For instance, an IP address of eth0 on Redhat has the key:
> /files/etc/sysconfig/network-scripts/ifcfg-eth0/IPADDR = "10.10.10.23"
> 
> On Gentoo, the key would be:
> /files/etc/conf.d/net/config_eth0/1 = "\"10.10.10.23/24\""
> 
> Should Augeas try to correlate different implementations, or should
> there be completely independent distribution-dependent lenses, and
> keys? If the latter, should Augeas a) support all distros out of the
> box, b) have a conditional distro-dependent build, or c) push
> responsibility to package maintainers?

The Augeas lens should stick as closely to what'sin the file as
possible; what you're describing is modelling on top of the actual
representation in the file. I fear that such modelling will always be
domain-specific and you'll invariably drop aspects of the file that
aren't important in one domain on the floor.

Beyond that, the bidirectional nature of Augeas puts fairly strong
restrictions on how you can reorganize the tree vs. the file
representation, so that even simple rearrangements of values won't be
possible.

What would be very interesting (and a lot of work) would be adding tree
<-> tree lenses that would allow people to reorganize the tree for their
purposes, and hopefully help them with abstracting distro-specific
differences away.

David





More information about the augeas-devel mailing list