Bug 679009

Summary: noSSLServerURL is not updated after rhel3/4 kickstarts from RHN Satellite v540
Product: Red Hat Satellite 5 Reporter: Paresh Mutha <pmutha>
Component: ProvisioningAssignee: Jan Pazdziora (Red Hat) <jpazdziora>
Status: CLOSED ERRATA QA Contact: Martin Minar <mminar>
Severity: medium Docs Contact:
Priority: medium    
Version: 540CC: cperry, fdewaley, jhutar, jpazdziora, mkoci, mminar, mzazrivec, prc
Target Milestone: ---Keywords: Patch, Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: spacewalk-java-1.2.39-58 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-17 02:29:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 703064    
Bug Blocks: 677501    

Description Paresh Mutha 2011-02-21 09:37:44 UTC
Description of problem:
After kickstarting a system to rhel3/4 from RHN Satellite v540, in / etc/sysconfig/rhn/up2date noSSLServerURL points to xmlrpc.rhn.redhat.com instead of pointing to local satellite from which it was kickstarted

Checking the kickstart files %post section we can see:

For RHEL4 kickstart on satellite V5.2:
perl-NPE 's/xmlrpc.rhn.redhat.com/rhnold1g.bserv1.local /'-i / etc/sysconfig/rhn/up2date

For RHEL4 kickstart on satellite V5.4:
perl-NPE 's | ^ (\ s * serverURL \ s *= \ s *[^:]+://)[^/]*/|${ rhnsat1g.bserv1.local 1} / |'-i / etc/sysconfig/rhn/up2date

Version-Release number of selected component (if applicable):
RHN Satellite v540

How reproducible:
Always

Steps to Reproduce:
1.Create a kickstart profile with base channel selected as RHEL4
2.Kickstart a system
3.Check noSSLServerURL in up2date file
  
Actual results:
noSSLServerURL=http://xmlrpc.rhn.redhat.com/XMLRPC

Expected results:
noSSLServerURL=http://satellite.fqdn/XMLRPC

Comment 3 Jan Pazdziora (Red Hat) 2011-04-07 14:45:17 UTC
Taking.

Comment 4 Jan Pazdziora (Red Hat) 2011-04-07 14:45:42 UTC
The problem was introduced by the fix for bug 576211.

Comment 5 Jan Pazdziora (Red Hat) 2011-04-07 14:48:49 UTC
Paresh,

my proposed patch would be:

--- a/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
+++ b/java/code/src/com/redhat/rhn/manager/kickstart/KickstartFormatter.java
@@ -639,12 +639,12 @@ public class KickstartFormatter {
 
         log.debug("adding perl -npe for /etc/sysconfig/rhn/up2date");
         if (this.ksdata.isRhel2()) {
-            retval.append("perl -npe 's|^(\\s*serverURL\\s*=\\s*[^:]+://)[^/]*/|${1}" +
+            retval.append("perl -npe 's|^(\\s*(noSSLS|s)erverURL\\s*=\\s*[^:]+://)[^/]*/|${1}" +
                      up2datehost +
                      "/|' -i /etc/sysconfig/rhn/rhn_register" + NEWLINE);
         }
         // both rhel 2 and rhel3/4 need the following
-        retval.append("perl -npe 's|^(\\s*serverURL\\s*=\\s*[^:]+://)[^/]*/|\\${1}" +
+        retval.append("perl -npe 's|^(\\s*(noSSLS|s)erverURL\\s*=\\s*[^:]+://)[^/]*/|\\${1}" +
                 up2datehost +
                 "/|' -i /etc/sysconfig/rhn/up2date" + NEWLINE);
 

to avoid any more checks for RHEL veersions. Does it sound reasonable?

Comment 6 Jan Pazdziora (Red Hat) 2011-04-07 15:31:33 UTC
Patch from comment 5 committed to upstream, Spacewalk master, 3241e638f6f406ec6ebfb4e5b30d59a4bdc0a232, to give it some exposure.

Comment 8 Paresh Mutha 2011-04-07 15:38:28 UTC
yes. It looks better than what I proposed and serves the purpose.

thnx!

Comment 9 Jan Pazdziora (Red Hat) 2011-04-08 08:17:11 UTC
Checkstyle fix in Spacewalk master, 34daa81f1bb843a72b18f4b897da4e2f71ae9248.

Comment 16 Milan Zázrivec 2011-06-13 14:30:50 UTC
Verified in stage w/ spacewalk-java-1.2.39-82 -> release pending.

Comment 17 Clifford Perry 2011-06-17 02:29:59 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

https://rhn.redhat.com/errata/RHSA-2011-0879.html