[augeas-devel] Some ideas about how to use Augeas with IPA

Dominique Dumont dominique.dumont at hp.com
Thu May 15 14:14:58 UTC 2008


David Lutterkort <dlutter at redhat.com> writes:

> On Wed, 2008-05-14 at 16:17 +0200, Dominique Dumont wrote:
>> I'm interested in making configuration easy for any user (including
>> newbies) even if it means providing a GUI [1] (which would not fit on
>> a really small system) with embedded help and 
>
> Not saying that it's the answer, but isn't that very close to the
> system-config-* tools in Fedora ?

We have similar objectives for the end user. 

System-config tools have an implementation where presentation (GUI),
the execution logic and the data (what parameters are authorized or
not...) all mixed together.

With Config::Model, the 3 parts are clearly separated:
- The presentation is done with separated UI (either graphical with
  Config::Model::TkUI, curses with Config::Model::CursesUI or terminal
  with Config::Model::TermUI
- The data is represented by a data structure (the configuration model)
- The execution logic is provided by Config::Model

The main advantage of this separation is to make maintenance and
evolution of configuration edition tools easier. When a project
evolve, only the configuration model need to be changed.

Furthermore, Config::Model should work on most unixes (including BSD),
not only of RedHat

Last but not least, one goal of Config::Model is to make possible to
project developers to provide a configuration tool for their
project. So I've tried to make the creation of a model from scratch
relatively easy: Config::Model::Itself provides a GUI to create
configuration model and all the rules and structure to guide a project
developer to create its configuration tool. (*)

>> immediate error return (i.e. at "set" time, not at "save" time)
>
> Just a wild thought: you could simulate that with Augeas with doing
> the following:
>      1. pass AUG_SAVE_NEWFILE to aug_init, so that aug_save will write
>         new stuff into files with .augnew extension
>      2. when users create a new entry in Config::Model, create a
>         'template' entry behind the scenes that you know is
>         syntactically correct, and as users fill in fields, modify the
>         template entry accordingly (those template entries would have to
>         be written manually for each config file)
>      3. every time you want to validate, call aug_save
>      4. when the user hits 'save' in the UI, call aug_save and move
>         the .augnew file over the 'proper' file

Since Config::Model performs its own validation, I don't need to rely
on Augeas validation capability. 

Well, OTOH, it could be an option if the model used by Config::Model
is rather weak (or too permissive). I'll keep that in mind.

Thanks for the suggestion.

(*) Config::Model::Itself is the "eat your own dog food" part of
Config::Model. ;-)

-- 
Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner




More information about the augeas-devel mailing list