[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[augeas-devel] Problems creating _almost empty_ file


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

which parses with no problems:

$ augtool
augtool> print tmp/test.min/

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.

Štěpán Balážik @ CZ.NIC

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]