[augeas-devel] Please confirm: Augeas cannot use number labels in node tests

Mol, Xavier (SCC) xavier.mol at kit.edu
Mon Jan 11 11:43:13 UTC 2016


Thank you Raphael,

 

nifty trick, that I should keep in mind.

 

Ciao,

Xavier.

 

From: Raphaël Pinson [mailto:raphael.pinson at camptocamp.com] 
Sent: Monday, January 11, 2016 11:54 AM
To: Mol, Xavier (SCC)
Cc: augeas-devel at redhat.com
Subject: Re: [augeas-devel] Please confirm: Augeas cannot use number labels in node tests

 

Hi Xavier,

 

 

Augeas XPath doesn't like digits are label values because it recognizes them as ints. The trick is to use `./` in front:

 

     match /*[./1 = "second"]

 

will work

 

 

Raphaël

 

On Mon, Jan 11, 2016 at 11:42 AM, Mol, Xavier (SCC) <xavier.mol at kit.edu> wrote:

Hello Augeas experts,

can someone please confirm to me, that Augeas is unable to relate to numbered nodes in nodes tests with their label?

augtool> set /a/1 "first"
augtool> set /b/1 "second"
augtool> match /*[1 = "second"]
error: Invalid path expression
error: type error
/*[1 = "second"]|=|

There are alternative expressions one can use to pick the right node - e.g.

augtool> match /*[*[1] = "second"]
/b = (none)
augtool> match /*[*[label() = "1"][. = "second"]]
/b = (none)

But still I'm wondering whether this is intentional.

Ciao,
Xavier.

PS: This one obviously fails, because the string "1" will never equal "second"...

augtool> match /*["1" = "second"]
  (no matches)



****
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/20160111/cb955170/attachment.htm>
-------------- 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/20160111/cb955170/attachment.p7s>


More information about the augeas-devel mailing list