Bug 576230 - [apache] Saving Apache configuration from RHQ UI destroys all comments
Summary: [apache] Saving Apache configuration from RHQ UI destroys all comments
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 3.0.0
Hardware: All
OS: Linux
high
high
Target Milestone: ---
: ---
Assignee: Filip Drabek
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: jon24-apache
TreeView+ depends on / blocked
 
Reported: 2010-03-23 15:18 UTC by Lukas Krejci
Modified: 2010-08-12 16:54 UTC (History)
2 users (show)

Fixed In Version: 2.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-08-12 16:54:34 UTC
Embargoed:


Attachments (Terms of Use)

Description Lukas Krejci 2010-03-23 15:18:24 UTC
Description of problem:

See title

How reproducible:

Always

Steps to Reproduce:
1. Have an httpd.conf file with comments
2. Update the apache configuration using RHQ and save it
3. Observe the havoc in the file after the update
  
Actual results:

All the comments text is lost. Only the leading # is left from all the lines that originally contained comments.

Expected results:

The comments should be preserved.

Additional info:

This is a bug in our augeas lens.

Comment 1 Filip Drabek 2010-04-22 10:49:12 UTC
workaround for this problem is to store the comments and don't use ageas del ([ del /([ \t]*(#.*)*)\n/ "#\n" ]) for comments.

Comment 2 Filip Drabek 2010-04-22 10:51:47 UTC
I have opened a ticket for this problem on https://fedorahosted.org/augeas/ticket/118 .

Comment 3 Charles Crouch 2010-04-23 13:08:49 UTC
The fix for this should be in Augeas 0.7.1. We need to retest with that.

Comment 4 Charles Crouch 2010-04-23 13:13:40 UTC
Or better yet, implement the workaround and test with the current 0.7.0 version

Comment 5 Corey Welton 2010-04-30 20:53:43 UTC
Just FYI - I don't know if this requires any RHQ code change, but it appears to fail w/ augeas 0.7.1

snippet of httpd.conf before change:


[root@jiaozi conf]# tail -n 20 httpd.conf
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
#    ServerAdmin webmaster.com
#    DocumentRoot /www/docs/dummy-host.example.com
#    ServerName dummy-host.example.com
#    ErrorLog logs/dummy-host.example.com-error_log
#    CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost jiaozi.usersys.redhat.com:80>
    ServerAdmin webmaster.com
    DocumentRoot /var/www/html/vhost
    ServerName jiaozi.usersys.redhat.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>


After changing the server admin for the vhost:
[root@jiaozi conf]# tail -n 20 httpd.conf
#
#
#
#
#
#
#
#
#
#
#
#
<VirtualHost jiaozi.usersys.redhat.com:80>
    ServerAdmin webmaster.redhat.com
    DocumentRoot /var/www/html/vhost
    ServerName jiaozi.usersys.redhat.com
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
#


[root@jiaozi conf]# rpm -qa|grep augeas
augeas-libs-0.7.1-1.fc12.x86_64
augeas-0.7.1-1.fc12.x86_64

Comment 6 Filip Drabek 2010-05-11 19:21:00 UTC
commit 689941199bfcfac9c1551f6192562e91bd9a6553

Comment 7 Corey Welton 2010-05-17 13:24:19 UTC
Hmm, I was still seeing this as of latest successful build on Friday; have assured that augeas 0.7.1 was running on agent platform...

Comment 8 Corey Welton 2010-05-18 12:56:45 UTC
QA Verified. Removing artifacts in /tmp from old testing resolved the issue.


This is perhaps something we should note in community release for anyone who might have tried and failed in the past to use this functionality.

Comment 9 Corey Welton 2010-08-12 16:54:34 UTC
Mass-closure of verified bugs against JON.


Note You need to log in before you can comment on or make changes to this bug.