[netcf-devel] Suggestions (renaming drv_initscripts, changing the internal xml format, displaying augeas errors)

David Lutterkort lutter at redhat.com
Wed Jul 29 17:13:12 UTC 2009


On Thu, 2009-07-23 at 15:06 +0200, Jonas Eriksson wrote:
> I thought that I should sum up some suggestions I would like to
> discuss and if possible implement or wake up one day and see them
> implemented (which happened today :) ).

You're a lucky man ;)

> How about renaming the initscripts driver to redhat or something
> similar? The SuSE driver will also target the initscript network
> configuration layer, and hopefully more drivers in the future as
> well.

Frankly, I assumed that SuSe's scripts were called something else[1]. I
am completely open to renaming the initscripts driver; it's not going to
be fun, but not a big issue either.

> I suggest that we change the xml format that data/xml/augeas.rng
> reflect, by changing the path attribute to an interface name
> attribute. The reason for this is that the path is quite
> irrelevant inside the XSLT, and only leads to duplication of data
> (i.e. the ifcfg_path as it is called in drv_initscripts.c).

The reason the XML contains all the duplication is that I wanted a dirt
simple format that can be turned into an Augeas tree in the most
braindead manner possible. That makes the tests that do nothing more
than XML transforms much more meaningful, since there's less danger of a
bug outside the transforms.

In an ideal world, there would be a tool to directly transform the netcf
XML into an Augeas tree; but there isn't, so I am using the augeas XML
as a very simple standin.

IOW, I don't want to put more smarts into the augeas XML <-> augeas tree
transform.

> When I was debugging a problem with aug_save, I noticed that it
> was quite hard to get exact error messages from augeas. I of
> added temporary debuging code that gave me this information,
> although augeas information ought to be more easily accessible
> than this. I therefore suggest adding the error state EAUGEAS (or
> similar) that would trigger a dump of /augeas//error and
> /augeas//error/message from the ERR_* macros. If this would be to
> much information, it could be enabled through the planned debug
> mode.

I would approach that slightly differently: we should just have another
ERR_ macro that we use to check for Augeas errors. That macro can
conditionally turn on aug_print(aug, stderr, "/augeas//error")

One of the things I want to add to Augeas is an error reporting
mechanism that makes it easier for programs to figure out what went
wrong. Once that's in place, we can hopefully produce nicer errors than
EOTHER when something goes wrong inside Augeas.

David

[1] The upstream repo for Fedora's scripts is suggestively at
git://git.fedorahosted.org/initscripts.git and the RPM is called
'initscripts'



More information about the netcf-devel mailing list