[augeas-devel] Non-empty string from get has turned into empty node for put direction - why?

Mol, Xavier (SCC) xavier.mol at kit.edu
Mon Dec 21 11:51:30 UTC 2015


Hi Raphael,

 

thank you for your quick response.

 

> The `mapping` lens has no label (…)

You're right, changing the lns definition to something like…

 

[ label "mapping" . dn . sp . (fqan . sp)? . login . eol ]

 

fixed most of the issues. Lens 'fqan' was again in itself a subnode of a labelless parent node, thus it did not show up, but now that this is understood, I could fix it easily (updated sources are attached). However, now we have an overlapping lens with an empty example in the Quote module:

 

$ augparse /usr/share/augeas/lenses/gridmapfile.aug

Syntax error in lens definition

/usr/share/augeas/lenses/gridmapfile.aug:25.2-30.44:Failed to compile mapping

/usr/share/augeas/lenses/gridmapfile.aug:23.10-.22:exception: overlapping lenses in tree union.put

    Example matched by both:

    First lens: /usr/share/augeas/lenses/dist/quote.aug:85.2-.35:

    Second lens: /usr/share/augeas/lenses/dist/quote.aug:74.2-.27:

 

 

I have altered Quote.dquote_spaces such that '#' in unquoted values are no longer accepted and the final statement looks like this:

 

[ lns . (bare|quoted) ]

 

To me that is identical to what the Quote module states:

 

[ lns . bare ]|[ lns . quoted ]

 

But augtool disagrees. Can you maybe explain the difference (in put direction) here?

 

 

Thank you once more for your time,

Xavier.

 

 

From: Raphaël Pinson [mailto:raphael.pinson at camptocamp.com] 
Sent: Monday, December 21, 2015 10:56 AM
To: Mol, Xavier (SCC)
Cc: augeas-devel at redhat.com
Subject: Re: [augeas-devel] Non-empty string from get has turned into empty node for put direction - why?

 

Hello Xavier,

 


The `mapping` lens has no label since all lenses in

 

    [ dn . sp . (fqan . sp)? . login . eol ]

 

 

are either subnodes (dn, fqan, login) or deletions (sp, eol)

 

 

Since Util.empty is also a label-less node, there is an ambiguity in the tree.

 

 

Most likely, you need to rethink `dn` so that it will provide the label for `mapping`.

 

 

 

Cheers,

 

Raphaël

 

 

 

 

 

On Mon, Dec 21, 2015 at 10:39 AM, Mol, Xavier (SCC) <xavier.mol at kit.edu> wrote:

Hello Augeas experts,

attached you can find another custom lens of mine, this time augparse identifies "overlapping lenses in tree union.put" and I don't understand why. This source file also contains some debugging output, which will produce this result:

$ augparse /usr/share/augeas/lenses/gridmapfile.aug
Concrete type of the 'mapping' regular expression:
/(([^\t\n \"#]+|\"[^\t\n \"#]+\")|\"[^\n\"]*[\t ]+[^\n\"]*\")[\t ]+((([^\t\n \"#]+|\"[^\t\n \"#]+\")|\"[^\n\"]*[\t ]+[^\n\"]*\")[\t ]+)?[.0-9A-Z_a-z-]+[\t ]*\n/
Abstract typeof the 'mapping' regular expression:
/\003\004/

Syntax error in lens definition
/usr/share/augeas/lenses/gridmapfile.aug:40.2-.42:Failed to compile lns
/usr/share/augeas/lenses/gridmapfile.aug:40.14-.39:exception: overlapping lenses in tree union.put
    Example matched by both:  {  }
    First lens: /usr/share/augeas/lenses/gridmapfile.aug:40.14-.29:
    Second lens: /usr/share/augeas/lenses/gridmapfile.aug:30.4-.44:


The node matched by the 'mapping' lens must be non-empty, which can be seen easily at the end of the regular expression, where Rx.word is included ([.0-9A-Z_a-z-]+). Yet in the put direction Augeas thinks an empty node can be used. Naturally, this is a conflict with Util.empty, which may occur in the same place as 'mapping', hence we've got an overlapping lens with 'lns'. Can anyone please explain to me why Augeas uses an empty node in the put direction for the 'mapping' lens?

Thank you for your time,
Xavier.

****
Karlsruher Institute of Technology (KIT)
Steinbuch Centre for Computing (SCC)

B. Sc. Xavier Mol
GridKa Storage Administrator and Support Manager

Hermann-von-Helmholtz-Platz 1
Geb. 449
76344 Eggenstein-Leopoldshafen
Phone: +49 721 608 23041
Email: xavier.mol at kit.edu
www.kit.edu
KIT - University of the State of Baden-Württemberg and National Large-scale Research Center of the Helmholtz Association
"Since 2010, the KIT has been certified as a family-friendly university."
****


_______________________________________________
augeas-devel mailing list
augeas-devel at redhat.com
https://www.redhat.com/mailman/listinfo/augeas-devel





 

-- 

Raphaël Pinson

Infrastructure Developer & Training Leader

+33 458 482 013

 

Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151221/3ef45a89/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gridmapfile.aug
Type: application/octet-stream
Size: 1217 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151221/3ef45a89/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6401 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20151221/3ef45a89/attachment.p7s>


More information about the augeas-devel mailing list