On 10/05/2010 01:14 PM, Doug Warner wrote: > Back on-list. > > On 10/04/2010 04:42 PM, Raphaƫl Pinson wrote: >> 2010/10/4 Doug Warner <[email protected] <mailto:[email protected]>> >> >> I split out the tests like you recommended; I was mostly just doing it >> that >> way to keep it simple for the time being. >> >> Setting options without a value will probably be necessary; I know linux >> can >> take options like that for kernel boot options (flags like "rhgb" and the >> like) and some modules might do the same thing. If you can point me at >> a lens >> that might do something similar I would appreciate it! >> >> Sure. See tests/test_mysql.aug for example. Usually what I do in this case is >> that I actually give an empty value to the node. This is easier as it allows >> to do a 'set /path/to/node ""' to create the node. >> > > That's what I'm trying to do in my test currently (set "/ip_gre/option2" "") > but I'm getting this error: > > test_modulesautoload.aug:72.2-74.32:exception thrown in test > test_modulesautoload.aug:72.7-73.28:exception: Value '' does not match regexp > /[^ \t\n#:]+/ in store lens > Lens: ./modulesautoload.aug:19.32-.45: > Error encountered at path /ip_gre/option2 > > Attached is the tests I've created and lens that you modified. >
Sorry; attached is a closer-to-working lens that doesn't include some stuff I was playing with. -Doug
(* Parsing /etc/modules.autoload.d/* *)
module ModulesAutoload=
autoload xfm
let sep_tab = Util.del_ws_tab
let sep_spc = Util.del_ws_spc
let eol = Util.eol
let indent = Util.indent
let s = Sep.space
let comment = Util.comment
let word = Rx.word | Rx.integer
let empty = Util.empty
let eq = Util.del_str "="
let optword = /[^ \t\n#:]+/
let opt = [ key word . ( eq . store optword )? ]
let record = [ key word . (s . Build.opt_list opt s)? . eol ]
let lns = ( empty | comment | record ) *
let xfm = transform lns (
incl "/etc/modules.autoload.d/*" .
Util.stdexcl
)
signature.asc
Description: OpenPGP digital signature
_______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
