[augeas-devel] Why does Augeas fail to handle empty files?
Mol, Xavier (SCC)
xavier.mol at kit.edu
Fri Feb 12 08:12:49 UTC 2016
Hello Augeas experts,
this issue was mentioned in a previous mail thread on this list (see attached final mail) and I've run into it again: Augeas seems to be quite strict about empty files (as opposed to non-existing files).
I have a lens defined like this 'let lns = properties? . ( filler | domain )*'. The actual meaning of the sub-lenses is not important right now, since per regular expression this should successfully match the void. It indeed does create new files, but it fails to update empty files and this is the error message I get:
"""
[root ~]# >/etc/dcache/layouts/f01-151-109-e.conf
[root ~]# augtool
augtool> print /files/etc/dcache/layouts/f01-151-109-e.conf
/files/etc/dcache/layouts/f01-151-109-e.conf
augtool> set /files/etc/dcache/layouts/f01-151-109-e.conf/properties/dcache.java.memory.heap 2g
augtool> print /files/etc/dcache/layouts/f01-151-109-e.conf
/files/etc/dcache/layouts/f01-151-109-e.conf
/files/etc/dcache/layouts/f01-151-109-e.conf/properties
/files/etc/dcache/layouts/f01-151-109-e.conf/properties/dcache.java.memory.heap = "2g"
augtool> save
error: Failed to execute command
saving failed (run 'errors' for details)
augtool> errors
Error in /etc/dcache/layouts/f01-151-109-e.conf (put_failed)
Failed to match
{ /properties/ }?
( { /#comment/ = /[^\001-\004\t\n\r ][^\001-\004\n]*[^\001-\004\t\n\r ]|[^\001-\004\t\n\r ]/ }
| { }
| { /domain/ = /[$.0-9A-Z_a-{}-]+/ })*
with tree
{ } { "properties" }
Lens: /var/lib/puppet/lib/augeas/lenses/dcachelayout.aug:29.12-.46:
"""
For some reason, there is an empty node before the properties node, which failes the put direction. For that the lens needs to be written like…
let lns = ( properties? . ( filler | domain )* )?
As far as regular expressions go, there is no effective change here, right? Yet for Augeas this clearly seems to make a difference. Can someone maybe explain this to me?
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: <mailto:xavier.mol at kit.edu> xavier.mol at kit.edu
<http://www.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 --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160212/95a76e5c/attachment.htm>
-------------- next part --------------
An embedded message was scrubbed...
From: "Mol, Xavier \(SCC\)" <xavier.mol at kit.edu>
Subject: Re: [augeas-devel] Why does Augeas fail to create new files?
Date: Tue, 22 Dec 2015 16:58:04 +0100
Size: 55470
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160212/95a76e5c/attachment.eml>
-------------- 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/20160212/95a76e5c/attachment.p7s>
More information about the augeas-devel
mailing list