Bug 679009 - noSSLServerURL is not updated after rhel3/4 kickstarts from RHN Satellite v540
Summary: noSSLServerURL is not updated after rhel3/4 kickstarts from RHN Satellite v540
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning
Version: 540
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Jan Pazdziora (Red Hat)
QA Contact: Martin Minar
URL:
Whiteboard:
Depends On: 703064
Blocks: sat541-blockers
TreeView+ depends on / blocked
 
Reported: 2011-02-21 09:37 UTC by Paresh Mutha
Modified: 2018-11-14 15:52 UTC (History)
8 users (show)

Fixed In Version: spacewalk-java-1.2.39-58
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-06-17 02:29:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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