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@osm unit/ = ch_ops:OPS-disk-only@osm unit/ = ch_dteam:DTEAM@osm unit/ = ch_dteam:DTEAM-disk-only@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: [email protected] 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." ****
poolmanager.aug
Description: Binary data
test_poolmanager.aug
Description: Binary data
poolmanager.conf
Description: Binary data
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
