[augeas-devel] Would any of the existing lenses support yaml?

Raphaël Pinson raphink at gmail.com
Fri Aug 8 18:41:15 UTC 2008


On Fri, Aug 8, 2008 at 8:30 PM, Bryan Kearney <bkearney at redhat.com> wrote:

>
>
> David Lutterkort wrote:
>
>> On Fri, 2008-08-08 at 14:08 -0400, Bryan Kearney wrote:
>>
>>> For thincrust, I would like to access a custom yaml file. Would any of
>>> the existing lenses support this?
>>>
>>
>> No, none do. YAML is actually pretty nasty to parse, since it depends so
>> heavily on indentation.
>>
>> You're probably better off writing a little script in python or Ruby to
>> parse the YAML file, make the changes you need and write it back out. Of
>> coure, if you feel like writing a lens, patches are always welcome ;)
>>
>
> Thanks... I will stick with ini for now. That way when .3 comes out I can
> use it.
>


I think doing a YAML lens is currently impossible. I see at least one
problem with it: YAML requires a constact indentation level, which means
augeas would have to get the indendation of a level and apply it to all
nodes on the same level, which is current not possible. That's just one
example of a problem with YAML.

Like David said, it's probably easier to use something like the YAML or
YAML::Simple Perl modules to parse it. I wonder how XML and YAML could be
included in augeas in the future, except by adding hardcoded classes in
augeas to be used in lenses.


Raphael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080808/7f2a1d22/attachment.htm>


More information about the augeas-devel mailing list