<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;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.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><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hello David,<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 for your helpful explaination. This is what I have learned from it:<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'>- Use '[ lns . bare ] | [ lns . quoted ]' if lns will have different labels/keys in either situation.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>- Use '[ lns . ( bare | quoted ) ]' when the keys/labels will be identical anyway.<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'>Even though Augeas does not make decisions solely based on the keys/labels, that is the primary guideline. Is this correct?<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'>With a sligthly different explaination, I've written documentation on the error "overlapping lenses in union.put" on the Augeas wiki (<a href="https://github.com/hercules-team/augeas/wiki/List-of-frequent-errors#overlapping-lenses-in-unionput">https://github.com/hercules-team/augeas/wiki/List-of-frequent-errors#overlapping-lenses-in-unionput</a>). The key argument there, too, is, that the keys for the tree nodes must be different to make Augeas happy.<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"'> David Lutterkort [mailto:lutter@watzmann.net] <br><b>Sent:</b> Tuesday, February 23, 2016 12:32 AM<br><b>To:</b> Mol, Xavier (SCC)<br><b>Cc:</b> RaphaĆ«l Pinson; augeas-devel@redhat.com<br><b>Subject:</b> Re: [augeas-devel] Non-empty string from get has turned into empty node for put direction - why?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><div><p class=MsoNormal>On Mon, Dec 21, 2015 at 3:51 AM, Mol, Xavier (SCC) <<a href="mailto:xavier.mol@kit.edu" target="_blank">xavier.mol@kit.edu</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have altered Quote.dquote_spaces such that '#' in unquoted values are no longer accepted and the final statement looks like this:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[ lns . (bare|quoted) ]</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>To me that is identical to what the Quote module states:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>[ lns . bare ]|[ lns . quoted ]</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>But augtool disagrees. Can you maybe explain the difference (in put direction) here?</span><o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>Yes, the difference is unfortunately terribly subtle: the first form says 'create a node in the tree from text matching "lns . (bare|quoted)"'. When the time comes to write a tree back to disk, we recognize that we are looking at such a node by comparing the node's key* with whatever key or label statements are inside the "[ ... ]" and then use "lns . (bare|quoted)" to write out that node and its children.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>The second form says 'create one of two possible nodes, depending on whether the text matches "lns . bare" or "lns .quoted"'. When we want to write out a tree with such a node, we first check whether that node matches "lns . bare" or "lns . quoted" and then proceed accordingly. To make that decision, the two constructs "[lns . bare]" and "[lns . quoted]" must match different kinds of tree nodes, i.e. it must be possible to make that decision from just looking at the key* of such a tree node. I assume that only "lns" in your example sets the key of a tree node; that means that Augeas can't determine whether it should use the first or the second "[ ... ]" in the overall construct. That's what it is complaining about with the error 'overlapping lenses in tree union.put': there's a construct "[ l1 ] | [ l2 ]", and at least for some tree nodes, both "[ l1 ]" and "[ l2 ]" would match so that Augeas can't tell which of these two to use.<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>I'd love to have a better error message for this situation (without the wall of text above ;)<o:p></o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>David<o:p></o:p></p></div><div><p class=MsoNormal>*: Augeas actually doesn't just look at the keys of tree nodes, but also at their values to determine whether a tree node matches a lens.<o:p></o:p></p></div></div></div></div></div></div></body></html>