On Fri, Apr 6, 2012 at 16:31, Dominic Cleal <[email protected]> wrote: > On 06/04/12 18:32, James Cammarata wrote: >> Is there a way to force augeas to rewrite entries that may already >> exist, especially where whitespace is concerned? The issue is when >> adding on to an existing list or hash, I still get this: >> >> cheetah_import_whitelist: >> - random >> - re >> - time >> -foo >> >> Which gets interpreted as invalid YAML due to the inconsistent >> spacing. Our settings file has grown organically over the years, and >> since it's usually only hand-edited rather than machine generated it >> has inconsistent whitespaces as Greg noted before. > > Hm, that's a big stumbling block with editing YAML through Augeas. > Augeas doesn't have a way to copy formatting from one block to another, > so it can't ensure indentation is identical. The only way would be to > change the string in "indent" that's used when nodes are created so it's > the same as existing entries upfront, which is tricky/imposssible. > > The only thing that comes to mind is using aug_to_xml or augtool's > dump-xml to write it out to XML and back to ensure consistency, but > we're missing the reverse function (Raphael was talking about this in > the Puppet thread earlier today). >
So not that I actually think this is a wonderful idea, but its a thought. Can we make it a requirement of using the new cobbler-settings adjuster that you run a "scrub" on your config file? _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
