<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Sprechblasentext Zchn";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.E-MailFormatvorlage17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.SprechblasentextZchn
        {mso-style-name:"Sprechblasentext Zchn";
        mso-style-priority:99;
        mso-style-link:Sprechblasentext;
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Raphael, all,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>some more finding about this…<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Neither 'touch', nor 'rename' can be used during a put unit test. Also, relying on Augeas users to do this just to insert a line break, which is required for a valid configuration file, is ugly and error prone. This workaround still may be used to add additional empty lines to a configuration file just to improve readability (where they don't break anything), so still a useful lesson. Though for my custom lens, I have decided to look for and create empty lines by default, as with any string literal. This way, the Augeas tree doesn't need to feature empty nodes and empty lines will be added in put direction automatically.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thank you again for your time,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xavier.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> augeas-devel-bounces@redhat.com [mailto:augeas-devel-bounces@redhat.com] <b>On Behalf Of </b>Mol, Xavier (SCC)<br><b>Sent:</b> Tuesday, December 22, 2015 10:27 AM<br><b>To:</b> Raphaël Pinson<br><b>Cc:</b> augeas-devel@redhat.com<br><b>Subject:</b> Re: [augeas-devel] How to insert empty nodes in Augeas trees?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Raphael,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>thank you again for your quick and helpful reply!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Ciao,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Xavier.<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=DE style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Raphaël Pinson [<a href="mailto:raphael.pinson@camptocamp.com">mailto:raphael.pinson@camptocamp.com</a>] <br><b>Sent:</b> Tuesday, December 22, 2015 10:25 AM<br><b>To:</b> Mol, Xavier (SCC)<br><b>Cc:</b> <a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br><b>Subject:</b> Re: [augeas-devel] How to insert empty nodes in Augeas trees?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Hello Xavier,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I was going to say that was not possible, but I actually (to my great surprise) found a way to do it:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>    augtool> touch /files/etc/fstab/01<o:p></o:p></p></div><div><p class=MsoNormal>    augtool> rename /files/etc/fstab/01 ""<o:p></o:p></p></div><div><p class=MsoNormal>    rename : /files/etc/fstab/01 to  1<o:p></o:p></p></div><div><p class=MsoNormal>    augtool> save<o:p></o:p></p></div><div><p class=MsoNormal>    Saved 1 file(s)<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Just added an empty line at the end of /etc/fstab<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Cheers,<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Raphaël<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Tue, Dec 22, 2015 at 10:06 AM, Mol, Xavier (SCC) <<a href="mailto:xavier.mol@kit.edu" target="_blank">xavier.mol@kit.edu</a>> wrote:<o:p></o:p></p><p class=MsoNormal>Hello Augeas experts,<br><br>is there a way to insert empty nodes in an Augeas tree? I've made a lens, that expects an empty line as last part (Util.empty), which works fine with existing files. However, when inserting a new node in the tree with that lens, the closing empty line is missing. Do I need to have a labelled node in the tree without value or children, that simply puts an empty line in the resulting string instead?<br><br>Thank you for your time,<br>Xavier.<br><br>****<br>Karlsruher Institute of Technology (KIT)<br>Steinbuch Centre for Computing (SCC)<br><br>B. Sc. Xavier Mol<br>GridKa Storage Administrator and Support Manager<br><br>Hermann-von-Helmholtz-Platz 1<br>Geb. 449<br>76344 Eggenstein-Leopoldshafen<br>Phone: <a href="tel:%2B49%20721%20608%2023041">+49 721 608 23041</a><br>Email: <a href="mailto:xavier.mol@kit.edu">xavier.mol@kit.edu</a><br><a href="http://www.kit.edu" target="_blank">www.kit.edu</a><br>KIT - University of the State of Baden-Württemberg and National Large-scale Research Center of the Helmholtz Association<br>"Since 2010, the KIT has been certified as a family-friendly university."<br>****<br><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><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>-- <o:p></o:p></p><div><div><div><div><p class=MsoNormal>Raphaël Pinson<o:p></o:p></p><div><p class=MsoNormal>Infrastructure Developer & Training Leader<o:p></o:p></p></div><div><p class=MsoNormal>+33 458 482 013<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>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><o:p></o:p></p></div></div></div></div></div></div></div></div></div></div></body></html>