[augeas-devel] SET fails with "too many matches" while MATCH finds zero

Mol, Xavier (SCC) xavier.mol at kit.edu
Tue Jan 5 10:57:29 UTC 2016


Hello Augeas experts,

attached you can find one of my custom lenses, a test module for it (both pass augparse successfully) as well as a real world example file I want to use the lens on. The problem here is, that I want to create new nodes with SET, if matching for their value returns no result, and that fails in _some_ situations.

* set a[. = "eggs"] "eggs"

should create a new node with label "a" and value "eggs", if it doesn't exist already (otherwise nothing happens).

* set a[. = "eggs"] "spam"

should create a new node with label "a" and value "spam", unless there is already a node with label "a" and value "eggs", in that case, the value is changed to "spam".


Hopefully, these two use cases are correct and reflect the intentions with Augeas' code base. Now onto my concrete issues...

augtool> match /augeas/version
/augeas/version = 1.4.0
augtool> defvar poolmanager /files/var/lib/dcache/config/poolmanager.conf
augtool> match $poolmanager/psu/create/pool
/files/var/lib/dcache/config/poolmanager.conf/psu[18]/create/pool = f01-151-104-e_1sT_shared
/files/var/lib/dcache/config/poolmanager.conf/psu[19]/create/pool = f01-151-104-e_2wT_shared
/files/var/lib/dcache/config/poolmanager.conf/psu[20]/create/pool = f01-151-104-e_3rT_shared
/files/var/lib/dcache/config/poolmanager.conf/psu[21]/create/pool = f01-151-104-e_4D_shared
augtool> match $poolmanager/psu/create/pool[. = "new_pool"]
  (no matches)
augtool> set $poolmanager/psu/create/pool[. = "new_pool"] "new_pool"
error: Too many matches for path expression
augtool> defnode this $poolmanager/psu/create/pool[. = "new_pool"]
error: Too many matches for path expression


I suppose I ran into another situation where hidden nodes are matched by augtool, which are not printed by MATCH? There are quite a number of empty lines/nodes and comments as well as similar "create" nodes, all of which have the very same problem:

augtool> ls /files/var/lib/dcache/config/poolmanager.conf/psu/create
unit/ = 0.0.0.0/0.0.0.0
unit/ = */*
unit/ = *@*
unit/ = ch_ops:OPS at osm
unit/ = ch_ops:OPS-disk-only at osm
unit/ = ch_dteam:DTEAM at osm
unit/ = ch_dteam:DTEAM-disk-only at osm
ugroup = world-net
ugroup = shared-disk-only-store
ugroup = shared-tape-store
pool = f01-151-104-e_1sT_shared
pool = f01-151-104-e_2wT_shared
pool = f01-151-104-e_3rT_shared
pool = f01-151-104-e_4D_shared
pgroup = all-pools
pgroup = all-tape-pools
pgroup = p2pClient-pools
pgroup = shared-disk-only-pools
pgroup = shared-write-tape-pools
pgroup = shared-read-tape-pools
pgroup = shared-stage-pools
pgroup = shared-prime-stage-pools
pgroup = shared-fallback-stage-pools
link/ = shared-disk-only-link
link/ = shared-write-tape-link
link/ = shared-read-tape-link
link/ = shared-prime-stage-link
link/ = shared-fallback-stage-link
linkGroup = shared-tape-linkGroup
linkGroup = shared-disk-only-linkGroup


Did I make a mistake in my lens definition? Or can you possibly confirm that this is a bug? Can I avoid this error by adapting the lens in some way?

Ciao,
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."
****

-------------- next part --------------
A non-text attachment was scrubbed...
Name: poolmanager.aug
Type: application/octet-stream
Size: 5689 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160105/bbcd9fad/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_poolmanager.aug
Type: application/octet-stream
Size: 5217 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160105/bbcd9fad/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poolmanager.conf
Type: application/octet-stream
Size: 4355 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160105/bbcd9fad/attachment-0002.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/20160105/bbcd9fad/attachment.p7s>


More information about the augeas-devel mailing list