Bug 709476 - Upgrading Pulp doesn't correctly enable the repo auth mod_python hooks
Summary: Upgrading Pulp doesn't correctly enable the repo auth mod_python hooks
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: Sprint 24
Assignee: Jay Dobies
QA Contact: Preethi Thomas
URL:
Whiteboard:
Depends On:
Blocks: verified-to-close
TreeView+ depends on / blocked
 
Reported: 2011-05-31 19:25 UTC by Jay Dobies
Modified: 2011-08-16 12:20 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-16 12:07:03 UTC
Embargoed:


Attachments (Terms of Use)

Description Jay Dobies 2011-05-31 19:25:12 UTC
I had a version of pulp-cds installed and upgraded to a new one. The newer pulp-cds.conf file (in /etc/httpd/conf.d) was laid down as pulp-cds.conf.rpmnew. That .rpmnew version doesn't have the mod_python hooks enabled.

Those hooks are manipulated in a %post section. A sed script is run to remove the comment prefix at the start of those lines. I'm guessing that since the file is named .rpmnew the sed script isn't being run on it.

It's also worth noting that I didn't edit pulp-cds.conf before upgrading. My initial thoughts were that RPM didn't want to overwrite my changes, but I hadn't made any.

I'm not sure what the solution is. We can probably dork with %files to have it always overwrite pulp-cds.conf, but I'm not sure if we expect users to be changing that at all. They shouldn't have to, so I think this is the right approach. Alternatively we could make the sed call in %post work on pulp-cds.conf*, but that feels a tad wonky.

Comment 1 Jay Dobies 2011-06-01 16:01:47 UTC
commit 8611770cf7ef00dd93ae9da35d05891476811f56
Author: Jay Dobies <jason.dobies>
Date:   Wed Jun 1 12:04:28 2011 -0400

    709476 - Our conf files should be replaced by default.

pulp.spec

Comment 2 Jeff Ortel 2011-06-02 05:56:46 UTC
build: 0.185

Comment 3 Preethi Thomas 2011-06-02 13:59:31 UTC
verified

[root@pulp-cds ~]# cat /etc/httpd/conf.d/pulp-cds.conf
# Apache configuration file for pulp web services and repositories
#
# Copyright © 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#
# Red Hat trademarks are not licensed under GPLv2. No permission is
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.

# Pulp common -----------------------------------------------------------------

AddType application/x-pkcs7-crl .crl
AddType application/x-x509-ca-cert .crt

# Example ssl cert and key files to get you started.
# This MUST match /etc/pulp/pulp.conf [security] 'cacert'.
# SSLCACertificateFile /etc/pki/pulp/ca.crt

# allow older yum clients to connect, see bz 647828
SSLInsecureRenegotiation on

# CDS -------------------------------------------------------------------------

WSGIProcessGroup pulp-cds
WSGIApplicationGroup pulp-cds
WSGIDaemonProcess pulp-cds user=apache group=apache processes=1 threads=8 display-name=%{GROUP}
WSGIScriptAlias /pulp/mirror /srv/pulp/cds.wsgi
WSGISocketPrefix /srv/pulp/

<Files cds.wsgi>
    WSGIPassAuthorization On
    WSGIProcessGroup pulp-cds
    WSGIApplicationGroup pulp-cds
    SSLRenegBufferSize  2147483648
    SSLRequireSSL
    SSLVerifyDepth 3
    SSLOptions +StdEnvVars +ExportCertData
    SSLVerifyClient optional
</Files>

# Pulp repositories -----------------------------------------------------------

Alias /pulp/repos /var/lib/pulp-cds

<Directory /var/lib/pulp-cds>

# The following lines are mod_python specific. In the RPM %post, lines with 
# are uncommented for operating systems that can use mod_python and mod_wsgi
# at the same time.

    AuthBasicAuthoritative Off
    Require valid-user

    AddHandler mod_python .py
    PythonAuthenHandler pulp.repo_auth.auth_handler_framework
    PythonDebug On

    SSLRequireSSL
    SSLVerifyClient optional_no_ca
    SSLVerifyDepth 2
    SSLOptions +StdEnvVars +ExportCertData
</Directory>
[root@pulp-cds ~]# yum update pulp-cds
testing-fedora-pulp                                      | 1.3 kB     00:00     
testing-fedora-pulp/primary                              | 3.6 kB     00:00     
testing-fedora-pulp                                                       11/11
updates/metalink                                         | 6.2 kB     00:00     
updates                                                  | 4.7 kB     00:00     
updates/primary_db                                       | 5.8 MB     00:02     
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package pulp-cds.noarch 0:0.0.185-1.fc14 set to be updated
--> Processing Dependency: pulp-common = 0.0.185 for package: pulp-cds-0.0.185-1.fc14.noarch
--> Running transaction check
---> Package pulp-common.noarch 0:0.0.185-1.fc14 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package         Arch       Version               Repository               Size
================================================================================
Updating:
 pulp-cds        noarch     0.0.185-1.fc14        testing-fedora-pulp      73 k
Updating for dependencies:
 pulp-common     noarch     0.0.185-1.fc14        testing-fedora-pulp      20 k

Transaction Summary
================================================================================
Upgrade       2 Package(s)

Total download size: 93 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): pulp-cds-0.0.185-1.fc14.noarch.rpm                |  73 kB     00:00     
(2/2): pulp-common-0.0.185-1.fc14.noarch.rpm             |  20 kB     00:00     
--------------------------------------------------------------------------------
Total                                            65 kB/s |  93 kB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : pulp-common-0.0.185-1.fc14.noarch                        1/4 
  Updating       : pulp-cds-0.0.185-1.fc14.noarch                           2/4 
warning: /etc/pulp/cds.conf saved as /etc/pulp/cds.conf.rpmsave
  Cleanup        : pulp-cds-0.0.182-1.fc14.noarch                           3/4 
  Cleanup        : pulp-common-0.0.182-1.fc14.noarch                        4/4 

Updated:
  pulp-cds.noarch 0:0.0.185-1.fc14                                              

Dependency Updated:
  pulp-common.noarch 0:0.0.185-1.fc14                                           

Complete!
[root@pulp-cds ~]# cat /etc/httpd/conf.d/pulp-cds.conf
# Apache configuration file for pulp web services and repositories
#
# Copyright © 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2
# along with this software; if not, see
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
#
# Red Hat trademarks are not licensed under GPLv2. No permission is
# granted to use or replicate Red Hat trademarks that are incorporated
# in this software or its documentation.

# Pulp common -----------------------------------------------------------------

AddType application/x-pkcs7-crl .crl
AddType application/x-x509-ca-cert .crt

# Example ssl cert and key files to get you started.
# This MUST match /etc/pulp/pulp.conf [security] 'cacert'.
# SSLCACertificateFile /etc/pki/pulp/ca.crt

# allow older yum clients to connect, see bz 647828
SSLInsecureRenegotiation on

# CDS -------------------------------------------------------------------------

WSGIProcessGroup pulp-cds
WSGIApplicationGroup pulp-cds
WSGIDaemonProcess pulp-cds user=apache group=apache processes=1 threads=8 display-name=%{GROUP}
WSGIScriptAlias /pulp/mirror /srv/pulp/cds.wsgi
WSGISocketPrefix /srv/pulp/

<Files cds.wsgi>
    WSGIPassAuthorization On
    WSGIProcessGroup pulp-cds
    WSGIApplicationGroup pulp-cds
    SSLRenegBufferSize  2147483648
    SSLRequireSSL
    SSLVerifyDepth 3
    SSLOptions +StdEnvVars +ExportCertData
    SSLVerifyClient optional
</Files>

# Pulp repositories -----------------------------------------------------------

Alias /pulp/repos /var/lib/pulp-cds

<Directory /var/lib/pulp-cds>

# The following lines are mod_python specific. In the RPM %post, lines with 
# are uncommented for operating systems that can use mod_python and mod_wsgi
# at the same time.

    AuthBasicAuthoritative Off
    Require valid-user

    AddHandler mod_python .py
    PythonAuthenHandler pulp.repo_auth.auth_handler_framework
    PythonDebug On

    SSLRequireSSL
    SSLVerifyClient optional_no_ca
    SSLVerifyDepth 2
    SSLOptions +StdEnvVars +ExportCertData
</Directory>


[root@pulp-cds ~]# ls -l /etc/httpd/conf.d/
total 36
-rw-r--r--. 1 root root 2266 Jun  2 09:52 pulp-cds.conf
-rw-r--r--. 1 root root 1690 May 27 06:40 pulp-cds.conf.rpmsave
-rw-r--r--. 1 root root 1671 Nov  2  2010 python.conf
-rw-r--r--. 1 root root  392 Oct 27  2010 README
-rw-r--r--. 1 root root 9534 Oct 27  2010 ssl.conf
-rw-r--r--. 1 root root  299 Oct 27  2010 welcome.conf
-rw-r--r--. 1 root root   43 Jan  5  2008 wsgi.conf

Comment 4 Preethi Thomas 2011-08-16 12:07:03 UTC
Closing with Community Release 15

pulp-0.0.223-4.

Comment 5 Preethi Thomas 2011-08-16 12:20:52 UTC
Closing with Community Release 15

pulp-0.0.223-4.


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