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, 12:15 PM
Harald Hoyer
 
Default augeas - reading/modifying/writing system configuration files

Hi,

just want to introduce augeas to you developers.

_What is augeas?_

From: http://augeas.net/

Augeas is a configuration editing tool. It parses configuration files in their native formats and transforms
them into a tree. Configuration changes are made by manipulating this tree and saving it back into native
config files.


Augeas is:

* An API provided by a C library
* A command line tool to manipulate configuration from the shell (and shell scripts)
* Language bindings to do the same from your favorite scripting language
* Canonical tree representations of common configuration files
* A domain-specific language to describe configuration file formats


_What can I do with augeas?_

Example: Set the default boot entry in grub

Shell:
# augtool
augtool> match /files/etc/grub.conf/title
/files/etc/grub.conf/title[1] = Fedora (2.6.25-14.fc9.x86_64)
/files/etc/grub.conf/title[2] = Linux 2.6.25-1
augtool> get /files/etc/grub.conf/default
/files/etc/grub.conf/default = 0
augtool> set /files/etc/grub.conf/default 1
augtool> save
augtool> quit
# grep default /etc/grub.conf
default=1

Python:
[root ~]# python
Python 2.5.1 (r251:54863, Apr 8 2008, 01:19:33)
[GCC 4.3.0 20080404 (Red Hat 4.3.0-6)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import augeas
>>> a = augeas.augeas()
>>> a.match("/files/etc/grub.conf/title")
['/files/etc/grub.conf/title[1]', '/files/etc/grub.conf/title[2]']
>>> a.get("/files/etc/grub.conf/default")
'0'
>>> a.set("/files/etc/grub.conf/default", "1")
True
>>> a.save()
True
>>>
# grep default /etc/grub.conf
default=1


C:
augeas *a = aug_init(NULL, NULL, AUG_NONE);
ret = aug_match(a, "/files/etc/grub.conf/title", &matches_p);
ret = aug_get(a, "/files/etc/grub.conf/default", &value);
ret = aug_set(a, "/files/etc/grub.conf/default", "1");
ret = aug_save(a);

Simple, isn't it? :-)

See also: http://augeas.net/tour.html

_What should use augeas?_

All system-config-* tools should use augeas, as well as every tool modifying system configuration files like
e.g. NetworkManager.


_Why should I switch my tool to use augeas?_

* not to reinvent the wheel
* one source to rule them all

_Where can I get augeas?_

augeas just passed the package review. https://bugzilla.redhat.com/show_bug.cgi?id=444792
python-augeas still needs someone doing the review. https://bugzilla.redhat.com/show_bug.cgi?id=444945

Meanwhile you can always download the source from: http://augeas.net/

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

Harald Hoyer wrote:

_What is augeas?_

From: http://augeas.net/

Augeas is a configuration editing tool. It parses configuration files in
their native formats and transforms them into a tree. Configuration
changes are made by manipulating this tree and saving it back into
native config files.

...

_Why should I switch my tool to use augeas?_

* not to reinvent the wheel
* one source to rule them all


* expect it to be included by default in f10+ {and el6+} ?
* expect it to become one of the mock build root packages ?

Why not ?
- is it a large library ?
- is it fast and efficient ?
- does it work on many arches ?
- when will it be considered production ready ?

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

_Which configuration files are supported?_

Try for yourself:

# augtool
augtool> ls "/files/etc/"
apt/ = (none)
ssh/ = (none)
sysconfig/ = (none)
inittab/ = (none)
aliases/ = (none)
grub.conf/ = (none)
pam.d/ = (none)
yum.repos.d/ = (none)
yum.conf/ = (none)
hosts/ = (none)
augtool> ls "/files/etc/sysconfig"
wpa_supplicant/ = (none)
system-config-users/ = (none)
spamassassin/ = (none)
saslauthd/ = (none)
samba/ = (none)
rsyslog/ = (none)
readonly-root/ = (none)
prelink/ = (none)
ntpd/ = (none)
nfs = (none)
network/ = (none)
netconsole = (none)
nasd/ = (none)
libvirtd = (none)
keyboard/ = (none)
kernel/ = (none)
irqbalance/ = (none)
irda/ = (none)
iptables-config/ = (none)
init/ = (none)
i18n/ = (none)
httpd = (none)
firstboot/ = (none)
crontab/ = (none)
crond/ = (none)
cpuspeed/ = (none)
clock/ = (none)
autofs/ = (none)
authconfig/ = (none)
atd = (none)
network-scripts/ = (none)
augtool>

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

On Mon, May 05, 2008 at 02:15:02PM +0200, Harald Hoyer wrote:
>
> C:
> augeas *a = aug_init(NULL, NULL, AUG_NONE);
> ret = aug_match(a, "/files/etc/grub.conf/title", &matches_p);
> ret = aug_get(a, "/files/etc/grub.conf/default", &value);
> ret = aug_set(a, "/files/etc/grub.conf/default", "1");
> ret = aug_save(a);
>
> Simple, isn't it? :-)

Pretty simple

>
> See also: http://augeas.net/tour.html
>
> _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.

>
> _Why should I switch my tool to use augeas?_
>
> * not to reinvent the wheel
> * one source to rule them all

Definitely, standardization on this field is pretty good from my point
of view.

Adam

--
Adam Tkac, Red Hat, Inc.

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

David Timms wrote:

> Harald Hoyer wrote:
>> _What is augeas?_
>>
>> From: http://augeas.net/
>>
>> Augeas is a configuration editing tool. It parses configuration files in
>> their native formats and transforms them into a tree. Configuration
>> changes are made by manipulating this tree and saving it back into
>> native config files.
> ...
>> _Why should I switch my tool to use augeas?_
>>
>> * not to reinvent the wheel
>> * one source to rule them all
>>
> * expect it to be included by default in f10+ {and el6+} ?
> * expect it to become one of the mock build root packages ?
>
> Why not ?
> - is it a large library ?
> - is it fast and efficient ?
> - does it work on many arches ?
> - when will it be considered production ready ?
>

Nice, but I think it would be nicer to implement this directly in python
(ducks...)

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

Neal Becker wrote:

Nice, but I think it would be nicer to implement this directly in python
(ducks...)



???

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

David Timms wrote:

Harald Hoyer wrote:

_What is augeas?_

From: http://augeas.net/

Augeas is a configuration editing tool. It parses configuration files
in their native formats and transforms them into a tree. Configuration
changes are made by manipulating this tree and saving it back into
native config files.

...

_Why should I switch my tool to use augeas?_

* not to reinvent the wheel
* one source to rule them all


* expect it to be included by default in f10+ {and el6+} ?


will be in rawhide soon and thus in F10


* expect it to become one of the mock build root packages ?


why should it be? BuildRequires ftw



Why not ?
- is it a large library ?


$ ls -lh /usr/lib64/libaugeas.so.0.0.0
-rwxr-xr-x 1 root root 110K 2008-05-05 14:47 /usr/lib64/libaugeas.so.0.0.0


- is it fast and efficient ?


efficient in reusability and stability
fast? where do you need speed? ok, maybe with you 500k /etc/hosts file


- does it work on many arches ?


all arches we support.


- when will it be considered production ready ?


well, as of now, it is pretty stable.

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

> _What should use augeas?_
>
> All system-config-* tools should use augeas, as well as every tool
> modifying system configuration files like e.g. NetworkManager.
>
> _Why should I switch my tool to use augeas?_
>
> * not to reinvent the wheel
> * one source to rule them all

If you have an existing already-invented parser for something, what's
the benefit?

Bill

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

Bill Nottingham 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.


_Why should I switch my tool to use augeas?_

* not to reinvent the wheel
* one source to rule them all


If you have an existing already-invented parser for something, what's
the benefit?

Bill



maintenance?

ok, if you read only, and your parser is dead simple, then there might be no sense to switch.
also, if your config file has a complicated special syntax and no augeas lens exist.

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

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

Not sure how serious you are with that; the reason it is _not_ written
in python (or perl or ruby or ...) is that I want it to be language
neutral so that config file descriptions can be reused in python and
ruby (and perl and ...)

David


--
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 09:40 PM.

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