[augeas-devel] cobbersettings lense

Greg Swift gregswift at gmail.com
Fri Apr 6 22:40:14 UTC 2012


On Fri, Apr 6, 2012 at 16:31, Dominic Cleal <dcleal at redhat.com> 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?




More information about the augeas-devel mailing list