[augeas-devel] Problems creating _almost empty_ file
Štěpán Balážik
stepan.balazik at nic.cz
Thu Aug 2 15:45:02 UTC 2018
Hi,
suppose I have the following lens:
module Minimal =
autoload xfm
let del_str = Util.del_str
let record_re = /[0-9]+/
let lns = [label "file" . del_str "BEGIN" . del_str "\n" . [label
"record" . store record_re . del_str "\n"]* . del_str "END" . del_str "\n"]
let filter = incl "/tmp/*.min"
let xfm = transform lns filter
and the following file
$ cat /tmp/test.min
BEGIN
END
which parses with no problems:
$ augtool
augtool> print tmp/test.min/
/files/tmp/test.min
/files/tmp/test.min/file
Now, when I want to create similar /programmatically /using augtool I
run into this:
$ augtool
augtool> set tmp/test2.min/file
augtool> save
error: Failed to execute command
saving failed (run 'errors' for details)
augtool> errors
Error in /tmp/test2.min:1.0 (parse_skel_failed)
Input string does not match at all
Lens: /usr/share/augeas/lenses/minimal.aug:8.10-.142:
When I was trying to create empty (or almost empty) file like this one
using the lenses distributed with Augeas (the one for /etc/hosts for
example) I ran to no such problems so I suppose I am doing something wrong.
Also note that this is a minimal example of a problem I ran into while
trying to generate files using much bigger lens we use (which can be
found here
https://gitlab.labs.nic.cz/knot/deckard/blob/master/pydnstest/deckard.aug).
Any kind of help would be much appreciated.
Thanks.
Regards
Štěpán Balážik @ CZ.NIC
//
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20180802/3934696d/attachment.htm>
More information about the augeas-devel
mailing list