[augeas-devel] Feature request: apply a given lense to a given file.

Robin Lee Powell rlpowell at digitalkingdom.org
Fri Jan 23 19:07:31 UTC 2009


On Mon, Jan 19, 2009 at 10:56:18AM -0800, David Lutterkort wrote:
> > It would be nice if I could tell augtool/the API (well, puppet
> > really, but that'd come later) something to the effect of "apply
> > this lense here to that file there; don't bother parsing
> > anything else".  Saves the trouble of producing another
> > essentially identical lense.
> 
> If it's good enough for general use, it should become an official
> lens.
> 
> But I completely agree there is a need to control file parsing at
> runtime, without putting anything into the lens dir. I imagine
> we'd do that by manipulating a special place underneath /augeas,
> say something like
> 
>         > augtool --noautoload
>         augtool> rm /augeas/transform/*
>         augtool> set /augeas/transform/samhain/lens Php.lns
>         augtool>
>         set /augeas/transform/samhain/incl /etc/samhain/samhainrc
>         augtool> load
>         
> where the name after /augeas/transform (the 'samhain' above), doesn't
> really matter.
> 
> To make that happen, I'd need to
> 
>       * expose the transforms read from .aug files in /augeas/transform
>       * add a 'load' command that throws away the exsting /files tree
>         and parses files according to what's in /augeas/transform
>       * add a '--noautoload' flag to augtool
> 
> Would that address your needs ?

As long as it could be done even if that flag hadn't been set, that
would be lovely.

FWIW, The other purpose I was thinking of is rather Puppet-specific,
which is being able to use Augeas to do things like add an arbitrary
line to the end of a file by having a lens that just sees files
as "trees" of their lines.

-Robin

-- 
They say:  "The first AIs will be built by the military as weapons."
And I'm thinking:  "Does it even occur to you to try for something
other than the default outcome?" -- http://shorl.com/tydruhedufogre
http://www.digitalkingdom.org/~rlpowell/ *** http://www.lojban.org/




More information about the augeas-devel mailing list