FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Development

 
 
LinkBack Thread Tools
 
Old 05-05-2008, 04:37 PM
David Lutterkort
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 11:50 -0400, Bill Nottingham wrote:
> If you have an existing already-invented parser for something, what's
> the benefit?

Uniformity ... there are lots of parsers for editing config files hidden
in various tools; they all give you a completely different "API" for
changing config files. And usually you can't get to them for any other
purpose than what the tool is written for.

Case in point: Webmin has a _ton_ of these config file editors in it.
Good luck trying to use those, even assuming you are working from a Perl
script (and better luck keeping that working across Webmin releases)

David


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-05-2008, 04:46 PM
David Lutterkort
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 15:08 +0200, Adam Tkac wrote:
> In my opinion we need one tool which will load plugins and
> configuration files should be modified through them.

That's kinda where I started from (with "plugin" meaning fairly
arbitrary code that gets loaded and executed) Since I wanted Augeas to
be language neutral (fancy way of saying "written in C"), that would
mean plugins written in C - and everybody loves writing text processing
code in C

Two big goals for Augeas for me are
1. has to be useful without any support from upstream (i.e., no "it
will work great if project X takes our patches")
2. describing a new config file format should be reasonably easy

The second one eventually got me to implement a domain-specific language
for file format descriptions. The description for /etc/hosts is at [1],
and a more detailed explanation of what is happening is at [2].

So, the "plugin" that needs to be shipped to enable Augeas to process
some config file X is a text file; right now, they are all shipped as
part of Augeas, but eventually, I'd hope that they can be maintained
closer to the source.

David

[1]
http://hg.et.redhat.com/misc/augeas?f=58bdfbc2e031;file=lenses/hosts.aug

[2] http://augeas.net/docs/writing-schemas.html


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-05-2008, 05:38 PM
David Malcolm
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 09:37 -0700, David Lutterkort wrote:
> On Mon, 2008-05-05 at 11:50 -0400, Bill Nottingham wrote:
> > If you have an existing already-invented parser for something, what's
> > the benefit?
>
> Uniformity ... there are lots of parsers for editing config files hidden
> in various tools; they all give you a completely different "API" for
> changing config files. And usually you can't get to them for any other
> purpose than what the tool is written for.
>
> Case in point: Webmin has a _ton_ of these config file editors in it.
> Good luck trying to use those, even assuming you are working from a Perl
> script (and better luck keeping that working across Webmin releases)

The other thing that doesn't seem to have been mentioned yet: how well
does augeas preserve whitespace/comments etc when writing changes back
out? (to play well with hand-edited config files) I got the impression
reading the web site that it does this "for free" once you've written
the input lens. (how well does it work?) I suspect that a hand-coded
parser typically won't do as good a job of this.

Hope this helps
Dave

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-05-2008, 06:05 PM
David Lutterkort
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 13:38 -0400, David Malcolm wrote:
> The other thing that doesn't seem to have been mentioned yet: how well
> does augeas preserve whitespace/comments etc when writing changes back
> out? (to play well with hand-edited config files)

Heh .. yeah, forgot to mention the point that caused most of the pain in
implementing: keeping comments, formatting detail etc. is incredibly
important and Augeas works very hard to meet an intutitve notion of
"minimal edit". At the same time, it does not rely on any
Augeas-specific annotation in the files, so that you can freely
interleave changing a file with Augeas with any other means of changing
it (from vi to your favorite Perl script)

> I got the impression reading the web site that it does this "for free"
> once you've written the input lens. (how well does it work?)

The files tests/*.rb[1] in the mercurial repo contain examples of how
changes to the tree correspond to changes in files. Diffs in those files
are against files in tests/root/ from the mercurial repo.

> I suspect that a hand-coded parser typically won't do as good a job of this.

Yeah, it's painful (I tried) It's also where the "original" parser from
whatever consumes those config files becomes useless for editing: they
typically discard all that information (as they should; there's no need
to hang on to that information if you're only reading config data)

David


[1]
http://hg.et.redhat.com/misc/augeas?cmd=manifest;manifest=04452485c2e89a718d09b fa6fe377da1fb9244b1;path=/tests/


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-05-2008, 10:21 PM
"Richard W.M. Jones"
 
Default augeas - reading/modifying/writing system configuration files

On Mon, May 05, 2008 at 09:25:24AM -0400, Neal Becker wrote:
> Nice, but I think it would be nicer to implement this directly in python
> (ducks...)

So we can get all the advantages of consuming huge amounts of memory,
being really slow, and not responding to the ^C key?

Rich.

--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-06-2008, 02:25 AM
seth vidal
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 23:21 +0100, Richard W.M. Jones wrote:
> On Mon, May 05, 2008 at 09:25:24AM -0400, Neal Becker wrote:
> > Nice, but I think it would be nicer to implement this directly in python
> > (ducks...)
>
> So we can get all the advantages of consuming huge amounts of memory,
> being really slow, and not responding to the ^C key?
>

Wow, You're really talking out of your element. So let's cruise through
some of these:
1. consuming huge amounts of memory: the 64bit memory doubling/tripling
effect isn't fun. That's true. On 32bit it is just fine, though.

2. I think you'll need to come up with a good example case for 'being
really slow'.

3. the ctrl-c problem (I assume you're speaking of yum here) is
directly related to rpm, written in C. Not anything to do with python.


-sv


--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-06-2008, 12:21 PM
"Richard W.M. Jones"
 
Default augeas - reading/modifying/writing system configuration files

On Mon, May 05, 2008 at 10:25:49PM -0400, seth vidal wrote:
> On Mon, 2008-05-05 at 23:21 +0100, Richard W.M. Jones wrote:
> > So we can get all the advantages of consuming huge amounts of memory,
> > being really slow, and not responding to the ^C key?
> >
>
> Wow, You're really talking out of your element. So let's cruise through
> some of these:
> 1. consuming huge amounts of memory: the 64bit memory doubling/tripling
> effect isn't fun. That's true. On 32bit it is just fine, though.

I'm not talking about some memory doubling effect, I'm talking about a
memory multiplication by large integer effect! Take a look at the
stats if you don't believe me:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=python

compared to say, C:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=gcc

or if you prefer a language with a similar ease of use, OCaml:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=all&lang=python&lang2=ocaml

Some of these Python programs are using > 10 x more memory and > 15 x
more CPU!

> 2. I think you'll need to come up with a good example case for 'being
> really slow'.
>
> 3. the ctrl-c problem (I assume you're speaking of yum here) is
> directly related to rpm, written in C. Not anything to do with python.

koji watch-task

Rich.

--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 
Old 05-06-2008, 07:47 PM
Ignacio Vazquez-Abrams
 
Default augeas - reading/modifying/writing system configuration files

On Mon, 2008-05-05 at 15:08 +0200, Adam Tkac wrote:
> On Mon, May 05, 2008 at 02:15:02PM +0200, Harald Hoyer wrote:
> > _What should use augeas?_
> >
> > All system-config-* tools should use augeas, as well as every tool
> > modifying system configuration files like e.g. NetworkManager.
>
> If we are talking about modifying system-config-* packages I think it
> is time to think if system-config packages are good configuration
> utilities. I think not.
>
> In my opinion we need one tool which will load plugins and
> configuration files should be modified through them. Every package which
> has configuration file will have simple plugin for one system wide
> tool and package maintainer should also maintain plugin for his
> package (because he knows about latest options etc).
>
> I know this will need hard work but in the end things will be far more
> better.

+1

One of the good things to come out of MS is MSC (even if some of the
consoles themselves are awful).

--
Ignacio Vazquez-Abrams <ivazqueznet@gmail.com>

PLEASE don't CC me; I'm already subscribed
--
fedora-devel-list mailing list
fedora-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-devel-list
 

Thread Tools




All times are GMT. The time now is 10:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org