[augeas-devel] Migrating config file formats

Doug Warner doug at warner.fm
Thu Jan 26 15:07:15 UTC 2012


I'm working on a lens to work with Gentoo's new /etc/conf.d/net format and I
realized I need to convert their old format to the new format.

What's the best way to migrate from one format to another?  I have my lens
mostly working for the new format now, but I realized I might need to parse
both versions; but then I thought that it might not update when augeas
reads/writes the config file.

I am using puppet to manage these files; so the values are typically set each
run; I'm hoping that would cause augeas to write down the new format rather
than leave it the old version.

I guess the last option is to wipe out the old file when I upgrade and let
puppet/augeas write down the new file, but that seems painful as well.

Any recommendations on what to do here?

I'll include sample of the old/new config below.

-Doug

old (normal bash arrays):
config_eth0=("192.168.0.1/24" "192.168.0.2/24")

new (newline delimited strings parsed as lists):
config_eth0="192.168.0.1/24
192.168.0.2/24"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20120126/2a61a46e/attachment.sig>


More information about the augeas-devel mailing list