Hi Tom,<br><br><br><div class="gmail_quote">On Sun, Dec 23, 2012 at 7:59 PM, Tom Limoncelli <span dir="ltr"><<a href="mailto:tal@whatexit.org" target="_blank">tal@whatexit.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Has anyone made a lens for YAML files?<br>
<br>
I noticed that cobbersettings.aug is a YAML-like file format.<br>
However, it doesn't handle 2 levels of indenting.<br>
<br></blockquote><div><br><br>This subject has been mentioned to me this week actually, as Marc Fournier asked me if it would be possible to support ElasticSearch, which uses YAML for its conffiles.<br><br>While it is possible to support a subtract of YAML, like it is already done for CobblerSettings and JSON, the full syntax could no be possible. In particular, YAML has several syntaxes for arrays and hashes. The one-line syntax is pretty much like JSON, but the multi-line syntax requires to have an identical indentation for every entry, something Augeas cannot do currently.<br>
<br>So, <br><br>    key: [ { key2: [ valA, valB ] } ]<br><br>could be supported, but<br><br>    key:<br>      - key2:<br>        - valA<br>        - valB<br><br>could not (again, currently).<br><br><br>Raphaël<br><br><br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I tried to extend cobblersettings.aug to handle something simple like this:<br>
<br>
key:<br>
 - key2:<br>
   - valA<br>
   - valB<br>
<br>
However, coding that is beyond my level of expertise.<br>
<br>
Ultimately I need to add the "{ key: val, key2: val2}" notation<br>
because the files that I need to manipulate look like:<br>
<br>
key:<br>
 - key2:<br>
   - {key3: val3, key4: val4}<br>
   - {key5: val5, key6: val6}<br>
   - {key6: val6, key7: val7}<br>
   key8: val8<br>
 - key9:<br>
   - {key10: val10, key11: val11}<br>
   - {key12: val12, key12: val12}<br>
   key13: val13<br>
<br>
However first I need to get through the issue of handling multiple<br>
levels of indentation.  Suggestions?<br>
<span class="HOEnZb"><font color="#888888"><br>
Tom<br>
<br>
--<br>
<a href="http://EverythingSysadmin.com" target="_blank">http://EverythingSysadmin.com</a>  -- my blog<br>
<a href="http://www.TomOnTime.com" target="_blank">http://www.TomOnTime.com</a> -- my videos<br>
<br>
_______________________________________________<br>
augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Raphaël Pinson<br>Administrateur Systèmes & Réseaux<br>
Camptocamp France<br>
Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>