On Wed, Mar 3, 2010 at 9:00 PM, David Lutterkort <span dir="ltr"><<a href="mailto:lutter@redhat.com">lutter@redhat.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 2010-03-02 at 23:24 -0500, Brandon Whalen wrote:<br>
> I am attempting to parse an httpd.conf file using augeas. I found the<br>
> httpd.aug and httpd.conf files associated with ticket #100. I<br>
> downloaded the latest git tree, built, and installed it. I then<br>
> downloaded the httpd.aug and the example httpd.conf files and<br>
> attempted to load the file in augtool. Initially augtool was unable to<br>
> parse the file at all. I found that httpd.aug had an error when it got<br>
> to the comments inside the IfModule declarations. In order to fix this<br>
> I applied the patch in [1]. After that the httpd.conf file was loaded<br>
> and I was able to see the sections fine.<br>
<br>
</div>Nice catch. I hope you're keeping track of the changes you are making.<br>
When you get the lens to work, it would be nice if you posted it here.<br>
<br>
Also, you might want to have a look at the entries about lens<br>
development on the Wiki[1] - in particular, you might want to use<br>
augparse and the unit testing support built into Augeas to make the lens<br>
more solid, rather than use augtool.<br>
<br>
For examples on how that works, look into lenses/tests/ in a git<br>
checkout. For example, to run the tests for the hosts lens (in<br>
lenses/hosts.aug) you'd run<br>
<br>
        cd GIT_CHECKOUT_OF_AUGEAS<br>
        augparse -I lenses lenses/tests/test_hosts.aug<br>
<div class="im"><br>
>  The problem I am currently having is that after I have loaded the<br>
> file, made a change, and then tried to save that change it fails as<br>
> shown in [2]. As I somewhat suspected when I place some debugging<br>
> output in it seems to be failing during the comment sections. I'd<br>
> really like to have this working and am hoping someone can point out<br>
> some error I've done with my edit to the .aug file, or with how I am<br>
> trying to use augtool. If this is a bug, I'd be glad to file something<br>
> in trac and attach any files that might help with the debugging.<br>
<br>
</div>What you are doing seems fine. You an get more details about the error<br>
by typing 'print /augeas//error' at the augtool prompt after the error<br>
happened (with the double slashes).<br>
<br>
If you post the output of the print here (or ping me on IRC), I can help<br>
you pinpoint what's going wrong.<br></blockquote><div><br></div><div><div>augtool> print /augeas//error</div><div>/augeas/files/etc/httpd/conf/httpd.conf/error = "put_failed"</div><div>/augeas/files/etc/httpd/conf/httpd.conf/error/path = "/files/etc/httpd/conf/httpd.conf(root)"</div>
<div>/augeas/files/etc/httpd/conf/httpd.conf/error/lens = "/usr/local/share/augeas/lenses/dist/httpd.aug:57.10-.63:"</div><div>/augeas/files/etc/httpd/conf/httpd.conf/error/message = "Short iteration"</div>
</div><div><br></div><div>Line 57 is the lens declaration statement</div><div>let lns = (directive | comment | virtualHost| sections| nesIf)*</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
David<br>
<br>
[1] <a href="http://augeas.net/page/Main_Page" target="_blank">http://augeas.net/page/Main_Page</a><br>
<br>
<br>
_______________________________________________<br>
augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" target="_blank">https://www.redhat.com/mailman/listinfo/augeas-devel</a><br>
</blockquote></div><br>