On Wed, 2011-08-10 at 15:20 +0200, Jiri Suchomel wrote: > Dne St 10. srpna 2011 14:12:48 Jiri Suchomel napsal(a): > > Hi! > > > > I'm trying to parse /etc/ldap.conf using ruby bindings. I do not want to > > parse other files, so this is my way to do it: > > > > aug = Augeas::open(nil, "", Augeas::NO_MODL_AUTOLOAD) > > aug.transform(:lens => "Spacevars.lns", :incl => "/etc/ldap.conf") > > aug.load > > OK, so it's not specific to ruby bindings, this is what I get with augtool: > > augtool --noautoload > augtool> set /augeas/load/Spacevars/lens "Spacevars.lns" > augtool> set /augeas/load/Spacevars/incl "/etc/ldap.conf" > augtool> load > error: Lens not found > error: Can not find lens Spacevars.lns
There is a gotcha here. Usually, the default, top level lens of a module is by convention "lns". In the case of Spacevars, the top level lens is "lns_simple". Hence, the correct load is this one: augtool> set /augeas/load/Spacevars/lens "Spacevars.lns_simple" Or, you can use the special syntax @Module to load the whole module, then you don't need to worry about the lens name at all, it will load it from the transform: augtool> set /augeas/load/Spacevars/lens "@Spacevars" Cheer, Francis _______________________________________________ augeas-devel mailing list [email protected] https://www.redhat.com/mailman/listinfo/augeas-devel
