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

Brandon Whalen bwhalen at gmail.com
Wed Mar 3 04:24:33 UTC 2010


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

Regards,
Brandon


[1]
--- httpd.aug   2010-01-21 12:35:01.000000000 -0500
+++ git/lenses/httpd.aug        2010-02-22 16:00:04.428722610 -0500
@@ -47,7 +47,7 @@

 (*let rec nesIf  = sec "IfModule" (nesIf|directive|comment)* *)
 let rec nesIf  =  [ wskey ("<IfModule") . params secarg . Util.del_str ">"
. eol .
-        (directive|nesIf)* . del ws "" . Util.del_str("</IfModule>") . eol
]
+        (directive|nesIf|comment)* . del ws "" .
Util.del_str("</IfModule>") . eol ]
 (* What we want ot say is *)
 (* let rec body = (directive|comment)* | ifModule body | directory body |
... *)
 (* but we can't typecheck that *)

[2]
[brandon at f12 augeas]$ augtool -b
augtool> set /files/etc/httpd/conf/httpd.conf/KeepAlive On
augtool> save
Saving failed
augtool>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20100302/37eb4223/attachment.htm>


More information about the augeas-devel mailing list