<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-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;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@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>Hello Augeas experts,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>this issue was mentioned in a previous mail thread on this list (see attached final mail) and I've run into it again: Augeas seems to be quite strict about empty files (as opposed to non-existing files).<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I have a lens defined like this 'let lns = properties? . ( filler | domain )*'. The actual meaning of the sub-lenses is not important right now, since per regular expression this should successfully match the void. It indeed does create new files, but it fails to update empty files and this is the error message I get:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>"""<o:p></o:p></p><p class=MsoNormal>[root ~]# >/etc/dcache/layouts/f01-151-109-e.conf<o:p></o:p></p><p class=MsoNormal>[root ~]# augtool<o:p></o:p></p><p class=MsoNormal>augtool> print /files/etc/dcache/layouts/f01-151-109-e.conf<o:p></o:p></p><p class=MsoNormal>/files/etc/dcache/layouts/f01-151-109-e.conf<o:p></o:p></p><p class=MsoNormal>augtool> set /files/etc/dcache/layouts/f01-151-109-e.conf/properties/dcache.java.memory.heap 2g<o:p></o:p></p><p class=MsoNormal>augtool> print /files/etc/dcache/layouts/f01-151-109-e.conf<o:p></o:p></p><p class=MsoNormal>/files/etc/dcache/layouts/f01-151-109-e.conf<o:p></o:p></p><p class=MsoNormal>/files/etc/dcache/layouts/f01-151-109-e.conf/properties<o:p></o:p></p><p class=MsoNormal>/files/etc/dcache/layouts/f01-151-109-e.conf/properties/dcache.java.memory.heap = "2g"<o:p></o:p></p><p class=MsoNormal>augtool> save<o:p></o:p></p><p class=MsoNormal>error: Failed to execute command<o:p></o:p></p><p class=MsoNormal>saving failed (run 'errors' for details)<o:p></o:p></p><p class=MsoNormal>augtool> errors<o:p></o:p></p><p class=MsoNormal>Error in /etc/dcache/layouts/f01-151-109-e.conf (put_failed)<o:p></o:p></p><p class=MsoNormal>  Failed to match<o:p></o:p></p><p class=MsoNormal>        { /properties/ }?<o:p></o:p></p><p class=MsoNormal>(    { /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ }<o:p></o:p></p><p class=MsoNormal>      | { }<o:p></o:p></p><p class=MsoNormal>      | { /domain/ = /[$.0-9A-Z_a-{}-]+/ })*<o:p></o:p></p><p class=MsoNormal>  with tree<o:p></o:p></p><p class=MsoNormal>    {  } { "properties" }<o:p></o:p></p><p class=MsoNormal>  Lens: /var/lib/puppet/lib/augeas/lenses/dcachelayout.aug:29.12-.46:<o:p></o:p></p><p class=MsoNormal>"""<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For some reason, there is an empty node before the properties node, which failes the put direction. For that the lens needs to be written like…<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>let lns = ( properties? . ( filler | domain )* )?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>As far as regular expressions go, there is no effective change here, right? Yet for Augeas this clearly seems to make a difference. Can someone maybe explain this to me?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thank you for your time,<o:p></o:p></p><p class=MsoNormal>Xavier.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><span style='font-size:10.0pt'>****<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Karlsruher Institute of Technology (KIT)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Steinbuch Centre for Computing (SCC)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>B. Sc. Xavier Mol<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>GridKa Storage Administrator and Support Manager<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:10.0pt'>Hermann-von-Helmholtz-Platz 1<o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:10.0pt'>Geb. 449<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>76344 Eggenstein-Leopoldshafen<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Phone: +49 721 608 23041<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>Email: </span><span lang=DE style='font-size:10.0pt'><a href="mailto:xavier.mol@kit.edu"><span lang=EN-US>xavier.mol@kit.edu</span></a></span><span style='font-size:10.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:10.0pt'><a href="http://www.kit.edu/"><span lang=EN-US>www.kit.edu</span></a></span><span style='font-size:10.0pt'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt'>KIT - University of the State of Baden-Württemberg and National Large-scale Research Center of the Helmholtz Association<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;mso-fareast-language:DE'>"Since 2010, the KIT has been certified as a family-friendly university."</span><span style='font-size:10.0pt'><o:p></o:p></span></p><p class=MsoNormal><span lang=DE style='font-size:10.0pt'>****<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>