[augeas-devel] Cannot save httpd.conf file after edit

Brandon Whalen bwhalen at gmail.com
Thu Mar 4 05:58:56 UTC 2010


On Wed, Mar 3, 2010 at 9:00 PM, David Lutterkort <lutter at redhat.com> wrote:

> On Tue, 2010-03-02 at 23:24 -0500, Brandon Whalen wrote:
> > I am attempting to parse an httpd.conf file using augeas. I found the
> > httpd.aug and httpd.conf files associated with ticket #100. I
> > downloaded the latest git tree, built, and installed it. I then
> > downloaded the httpd.aug and the example httpd.conf files and
> > attempted to load the file in augtool. Initially augtool was unable to
> > parse the file at all. I found that httpd.aug had an error when it got
> > to the comments inside the IfModule declarations. In order to fix this
> > I applied the patch in [1]. After that the httpd.conf file was loaded
> > and I was able to see the sections fine.
>
> Nice catch. I hope you're keeping track of the changes you are making.
> When you get the lens to work, it would be nice if you posted it here.
>
> Also, you might want to have a look at the entries about lens
> development on the Wiki[1] - in particular, you might want to use
> augparse and the unit testing support built into Augeas to make the lens
> more solid, rather than use augtool.
>
> For examples on how that works, look into lenses/tests/ in a git
> checkout. For example, to run the tests for the hosts lens (in
> lenses/hosts.aug) you'd run
>
>        cd GIT_CHECKOUT_OF_AUGEAS
>        augparse -I lenses lenses/tests/test_hosts.aug
>
> >  The problem I am currently having is that after I have loaded the
> > file, made a change, and then tried to save that change it fails as
> > shown in [2]. As I somewhat suspected when I place some debugging
> > output in it seems to be failing during the comment sections. I'd
> > really like to have this working and am hoping someone can point out
> > some error I've done with my edit to the .aug file, or with how I am
> > trying to use augtool. If this is a bug, I'd be glad to file something
> > in trac and attach any files that might help with the debugging.
>
> What you are doing seems fine. You an get more details about the error
> by typing 'print /augeas//error' at the augtool prompt after the error
> happened (with the double slashes).
>
> If you post the output of the print here (or ping me on IRC), I can help
> you pinpoint what's going wrong.
>

augtool> print /augeas//error
/augeas/files/etc/httpd/conf/httpd.conf/error = "put_failed"
/augeas/files/etc/httpd/conf/httpd.conf/error/path =
"/files/etc/httpd/conf/httpd.conf(root)"
/augeas/files/etc/httpd/conf/httpd.conf/error/lens =
"/usr/local/share/augeas/lenses/dist/httpd.aug:57.10-.63:"
/augeas/files/etc/httpd/conf/httpd.conf/error/message = "Short iteration"

Line 57 is the lens declaration statement
let lns = (directive | comment | virtualHost| sections| nesIf)*



>
> David
>
> [1] http://augeas.net/page/Main_Page
>
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20100304/8feb7a4c/attachment.htm>


More information about the augeas-devel mailing list