Bug 786222

Summary: Unable to export a system template containing a <repository> for a single RHEL release
Product: Red Hat Satellite Reporter: James Laska <jlaska>
Component: WebUIAssignee: Brad Buckingham <bbuckingham>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.0.1CC: cpelland, cwelton, jturner, mmccune
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-0.1.222-2.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:24:00 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: 747354    

Description James Laska 2012-01-31 18:43:13 UTC
Description of problem:

After syncing multiple RHEL versions and releases, there doesn't appear to be a method to export a system template for a single RHEL version (e.g. just RHEL6.1).

For example, when creating a system template, "Red Hat Enterprise Linux Server" is the only available RHEL product choice.  If I add that product to my template, all promoted versions and releases of that product (5.1 - 6.2) show up in the exported system template.

Additionally, if I add a single repository from that product (e.g. "Red Hat Enterprise Linux 6 Server RPMS x86_64 6.1"), I am unable to select a distribution from the system template ... "No products are currently associated with this system template. Please associate a product that contains distributions in order to select a distribution."

Version-Release number of selected component (if applicable):
 * candlepin-0.5.14-1.el6.src.rpm
 * katello-0.1.200-3.el6.src.rpm
 * katello-certs-tools-1.0.2-2.el6.src.rpm
 * katello-cli-0.1.44-2.el6.src.rpm
 * katello-configure-0.1.55-2.el6.src.rpm
 * katello-httpd-ssl-key-pair-1.0-1.src.rpm
 * katello-qpid-broker-key-pair-1.0-1.src.rpm
 * katello-selinux-0.1.3-1.el6.src.rpm
 * katello-trusted-ssl-cert-1.0-1.src.rpm
 * pulp-0.0.256-1.el6.src.rpm

How reproducible:
 * Everytime

Steps to Reproduce:
1. Install RHEL6.2
2. Enable katello repository, install katello-all and run katello-configure
3. Import manifest
4. Enable, sync and promote, RHEL 5.7, 5.8 (Beta), 5Server , 6.1, 6.2 and 6Server
5. Attempt to create a system template for *only* RHEL6.1 content
  
Actual results:

 1) Unable to add a specific version of the product to a template
 2) After adding the entire product, all promoted RHEL releases are included in the exported template

# grep '<repository name="Red' Downloads/rhel-6.1-Stage-export.xml 
    <repository name="Red Hat Enterprise Linux 6 Server RPMs x86_64 6.1">
    <repository name="Red Hat Enterprise Linux 6 Server RPMs x86_64 6.2">
    <repository name="Red Hat Enterprise Linux 6 Server RPMs x86_64 6Server">
    <repository name="Red Hat Enterprise Linux 5 Server RPMs x86_64 5Server">

Expected results:

# grep '<repository name="Red' Downloads/rhel-6.1-Stage-export.xml 
    <repository name="Red Hat Enterprise Linux 6 Server RPMs x86_64 6.1">

Additional info:

Comment 1 Mike McCune 2012-01-31 18:45:15 UTC
We need to allow picking of distributions based on *repo* and not product level.

Comment 2 James Laska 2012-01-31 18:50:40 UTC
A fun side-effect when having a template that includes multiple <repositories> for different RHEL versions is that the resulting CloudForms image deployment fails spectacular.  This is expected if you were to attempt to install packages from both RHEL5 and RHEL6.

> Error: Package: python-simplejson-2.0.9-8.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>    Requires: python(abi) = 2.4
>    Installed: python-2.6.6-29.el6.x86_64 (@koji-override-0/$releasever)
>        python(abi) = 2.6
>    Available: python-2.4.3-19.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-21.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-24.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-24.el5_3.6.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-27.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-27.el5_5.2.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-27.el5_5.3.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-43.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-44.el5.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.4.3-44.el5_7.1.x86_64 (Red_Hat_Enterprise_Linux_5_Server_RPMs_x86_64_5Server)
>        python(abi) = 2.4
>    Available: python-2.6.5-3.el6.i686 (Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6.1)
>        python(abi) = 2.6
>    Available: python-2.6.5-3.el6_0.2.i686 (Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6.1)
>        python(abi) = 2.6
>    Available: python-2.6.6-20.el6.x86_64 (Red_Hat_Enterprise_Linux_6_Server_RPMs_x86_64_6.1)
>        python(abi) = 2.6


Escalating for consideration as a release blocker.  I suspect promoting content from multiple product versions will be common.

Comment 3 Brad Buckingham 2012-02-01 20:41:16 UTC
commit - a5489f673436687b647d2736a59cff2a0ccc22f5

This commit changes the logic for adding of distributions to a system template. 

Before the commit, a template had to have a product associated with it, in
order to assign a distribution.  In addition, the distributions that could be
assigned would be based on those that are available as part of the template's
products.

After this commit, a template has to have either a product or repository
associated with it, to assign a distribution.  The distributions available will
be based on those available as part of those products & repos.  This allows the
user to create a template consisting of products, repos or a combination.

Comment 4 James Laska 2012-02-08 14:35:57 UTC
Fix available for test in katello-0.1.222-2.el6

Comment 5 James Laska 2012-02-14 20:48:42 UTC
I believe the version of katello I'm testing has this fix, however the problem remains.

Since distribution selection is not possible in the web-ui, I had to work around bug#788599 using katello shell...

> template update --name configserver  --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-x86_64"

After promoting that template, the resulting system template still contains ...
  <!-- Template is not complete and will likely fail. -->
  <!--  - Exactly one distribution must be present to export a TDL -->
and does not include a <install> section.

I tested with the following package versions:
 * katello-0.1.235-2.el6.src.rpm
 * katello-certs-tools-1.0.2-2.el6.src.rpm
 * katello-cli-0.1.54-3.el6.src.rpm
 * katello-configure-0.1.64-3.el6.src.rpm
 * katello-httpd-ssl-key-pair-1.0-1.src.rpm
 * katello-qpid-broker-key-pair-1.0-1.src.rpm
 * katello-selinux-0.1.3-1.el6.src.rpm
 * katello-trusted-ssl-cert-1.0-1.src.rpm

Comment 6 James Laska 2012-02-14 20:53:39 UTC
Apologies, I believe this issue *is* resolved.  My previous test was using a template that had unpromoted changes present.  After re-promoting the template (while working around bug#788599), the exported system template *does* contain a <install> section.

I'll leave this in ON_QA until it's possible to truly confirm, without working around #788599.  Apologies for the email traffic.

Comment 7 Corey Welton 2012-02-28 21:37:19 UTC
QA Verified. After syncing multiple RHEL repos and subsequently trying to add only one to a template, the resulting template contains only the requested repo.

Comment 9 Mike McCune 2013-08-16 18:20:05 UTC
getting rid of 6.0.0 version since that doesn't exist