Bug 236376

Summary: Package Profile generated with no packages for sync'ing when selecting Sync Package profile: With system's existing package profile under Advanced Kickstart Configuration
Product: Red Hat Satellite 5 Reporter: Clifford Perry <cperry>
Component: ProvisioningAssignee: Jan Pazdziora <jpazdziora>
Status: CLOSED CURRENTRELEASE QA Contact: Steve Salevan <ssalevan>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jpazdziora, rhn-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat500 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-26 03:06:23 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:    
Bug Blocks: 173427    

Description Clifford Perry 2007-04-13 14:39:03 UTC
Description of problem:
If I go to schedule the reinstall of a registered client within a 4.2 or 5.0 (in
QA Satellite -20 ISO version) where the OS is the same, so no change in OS, such
as RHEL 4 AS -> RHEL 4 AS - and after selecting the kickstart profile I wish to
use, hit the 'Advanced Configuration' button to get to the Advanced Kickstart
Configuration section, and then choose: 

Sync Package Profile: 	With system's existing package profile

And hit 'Schedule Kickstart and Finish' the resultant kickstart session shows on
the right side:
Sync system to package profile

Where 'package profile' has a link to - /network/profiles/details.pxt?prid=1

which when you then click on it and then 'packages' goes to
/network/profiles/package-list.pxt?prid=1 and states:


The following packages are associated with this stored profile.
No packages in this profile.

So, even if I let the kickstart proceed, which I did the kickstart sucessfully
picks up the request to sync package profile, but because it is empty, nothing
useful happens. 

This creation of packages into the package profile needs to occurr successfully
for systems using kickstart profiles who wish to reinstall a system, keeping the
same registration and ensure it is reinstalled with the same package set. 

Creation of this bug was due to a review of this code path/usage of Satellite
kickstart due to question posted on rhn-satellite-users list:
https://www.redhat.com/mailman/private/rhn-satellite-users/2007-April/msg00028.html

Keeping this bug report public and placing under rhn 500 Satellite triage for
main developer review. 

Cliff.

Comment 2 Jan Pazdziora 2007-04-20 11:40:52 UTC
The following patch seems to do the trick -- populating that newly created profile:

Index: java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
===================================================================
--- java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
       (revision 115103)
+++ java/code/src/com/redhat/rhn/manager/kickstart/KickstartScheduleCommand.java
       (working copy)
@@ -538,7 +538,7 @@
             retval = ProfileManager.createProfile(
                     ProfileFactory.TYPE_SYNC_PROFILE, this.user, 
                         this.server.getBaseChannel(), pname, pname);
-            
+            ProfileManager.copyFrom(this.server, retval);
         }
         // Profile of 'stored profile'
         else if (profileTypeIn.equals(TARGET_PROFILE_TYPE_PACKAGE)) {


Comment 3 Jan Pazdziora 2007-04-20 13:43:55 UTC
Based on Cliff's not in bug 236379 comment 2, I've committed the fix to SVN,
trunk, revision 115155.

Taking over this bug for possible kickbacks, Mike, shout if you want to keep it.

Comment 4 Jan Pazdziora 2007-04-20 18:59:16 UTC
Moving ON_QA with 5.0.0-26 ISO available.

Comment 5 Preethi Thomas 2007-04-24 17:22:59 UTC
verified

Comment 6 Steve Salevan 2007-06-19 15:58:33 UTC
Looks good on Stage-verified Satellite; moving to RELEASE_PENDING.

Comment 7 Brandon Perkins 2007-06-26 03:06:23 UTC
Closed for Satellite 500 Release.