Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 742262 - system template package groups are tied to a repository
Summary: system template package groups are tied to a repository
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: API
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Tomas Strachota
QA Contact: Sachin Ghai
URL:
Whiteboard:
Depends On:
Blocks: katello-blockers
TreeView+ depends on / blocked
 
Reported: 2011-09-29 14:26 UTC by Justin Sherrill
Modified: 2019-09-26 17:46 UTC (History)
4 users (show)

Fixed In Version: katello-0.1.86-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-22 17:59:19 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Justin Sherrill 2011-09-29 14:26:40 UTC
In Katello we seem to have implemented package and package group associations to system templates in two completely different ways and I am not sure of the purpose.  


Packages
associated to system templates via a name, version, release that we store in the db.


Package Groups
associated to system templates via a repo_id and system_group_id


I'm not sure of the purpose of the repo_id, system_group_id association here.  I know in pulp you have to list groups by their repo, but can't we just store the group name associated to the system template instead?  

Upon system template application we aren't installing the package group from a particular repo are we (We aren't with packages)?  If not, what is the point of it?

Comment 1 Ivan Necas 2011-09-29 14:52:45 UTC
The purpose of adding repo_id was to make the association unique. There might
be two package groups with the same name in two repositories with different
content. Which one we will use? With packages the problem does not seem so
obvious because packages use to have unique names. But beside this there is no
other reason to have both repo and group id associated to template.

Comment 2 Justin Sherrill 2011-09-29 15:04:49 UTC
But aren't we going to just tell the client to install this group "X" and whatever products/repos it has installed it will use?  I'm assuming we aren't going to tell the system/client to install a particular group from a particular repo, correct?

Comment 3 Ivan Necas 2011-09-29 15:13:06 UTC
I don't know for sure. @brian?

Comment 4 Bryan Kearney 2011-09-29 17:41:26 UTC
I believe justin to be correct here. I will choose to install @base. If I have 2 repos which provide that, unknown what will happen.

Comment 5 Justin Sherrill 2011-09-29 17:56:55 UTC
I believe that yum will just pull down the packages from both groups named @base if that were the case. 

 I think in rhel 5 we actually had this scenario where Cluster defined an @base group (just like RHEL).  And so if you kickstarted with the Cluster repo enabled and used @base it would pull the normal packages from rhel as well as the @base from Cluster.

Comment 6 Tomas Strachota 2011-09-30 07:59:26 UTC
Taking.

The same problem is with package group categories. I'll remove repo associations and change validations to check if the package group (or category) is anywhere in the Locker.

Comment 7 Tomas Strachota 2011-10-05 17:03:04 UTC
Implementation changed according to requirements.
Names are also used in the CLI for package groups now.

Comment 9 Sachin Ghai 2012-03-20 09:17:06 UTC
Hi Tomas, Could you please help to share the steps to verify this defect. thanks

Comment 10 Tomas Strachota 2012-03-20 10:42:55 UTC
Hi Sachin,
this bug was about:
1) remove dependency of template's package groups on repositories
2) switching cli to use names for selecting package groups when a user adds them into templates

So I suggest to test:
1) if it is possible to add/remove package group from template by name
2) if the template exports contain the expected package groups after promotion

Comment 11 Sachin Ghai 2012-03-21 11:31:33 UTC
Verified on following CFSE build:

[root@scroponok ~]# rpm -qa | grep katello
katello-selinux-0.1.8-1.el6.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-cli-common-0.1.105-1.el6.noarch
katello-all-0.1.304-1.el6.noarch
katello-glue-candlepin-0.1.304-1.el6.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-cli-0.1.105-1.el6.noarch
katello-glue-foreman-0.1.304-1.el6.noarch
katello-configure-0.1.104-1.el6.noarch
katello-certs-tools-1.0.4-1.el6.noarch
katello-glue-pulp-0.1.304-1.el6.noarch
katello-common-0.1.304-1.el6.noarch
katello-0.1.304-1.el6.noarch
[root@scroponok ~]# 

I added the package group name in system template by name. here for e.g. "Backup client" and same is contain in the exported template as in next comment 

katello> template create --name mytemp1 --org sghai
Successfully created template [ mytemp1 ]

katello> template list --org sghai
--------------------------------------------------------------------------------
                                 Template List

 Id   Name      Description   Environment Id   Parent Id  
--------------------------------------------------------------------------------
 6    mytemp1   None          3                None      

katello> template update --name mytemp1 --org sghai --from_product "Red Hat Enterprise Linux Server" --add_repository "Red Hat Enterprise Linux 6 Server RPMs x86_64 6.2"
Successfully updated template [ mytemp1 ]

katello> template update --name mytemp1 --org sghai --add_package "zsh"
Successfully updated template [ mytemp1 ]

katello> template update --name mytemp1 --org sghai --add_package_group "Backup Client"
Successfully updated template [ mytemp1 ]

katello> template update --name mytemp1 --org sghai --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-x86_64"
Successfully updated template [ mytemp1 ]

katello> changeset create --name sghai_test --org sghai --env dev 
Successfully created changeset [ sghai_test ] for environment [ dev ]
katello> changeset update --add_product "Red Hat Enterprise Linux Server" --name sghai_test --org sghai --env dev
Successfully updated changeset [ sghai_test ]
katello> changeset update --add_template mytemp1 --env dev --org sghai --name sghai_test
Successfully updated changeset [ sghai_test ]
katello> changeset promote --name sghai_test --org sghai --env dev
Changeset [ sghai_test ] promoted

Comment 12 Sachin Ghai 2012-03-21 11:32:50 UTC
Thanks Tomas for sharing the steps to verify this defect.

katello> template export --name mytemp1 --format tdl --file /root/mytemp.xml --org sghai --env dev
Template was exported successfully to file /root/mytemp.xml
katello> exit
[root@scroponok ~]# xmllint --format --recover /root/mytemp.xml 
<?xml version="1.0" encoding="UTF-8"?>
<template>
  <name>mytemp1</name>
  <os>
    <name>RHEL-6</name>
    <version>2</version>
    <arch>x86_64</arch>
    <install type="url">
      <url>http://scroponok.lab.eng.pnq.redhat.com/pulp/ks/sghai/dev/content/dist/rhel/server/6/6.2/x86_64/os/</url>
    </install>
    <rootpw>redhat</rootpw>
  </os>
  <packages>
    <package name="zsh"/>
    <package name="@Backup Client"/>
  </packages>
  <repositories>
    <repository name="Red Hat Enterprise Linux 6 Server RPMs x86_64 6.2">
      <url>https://scroponok.lab.eng.pnq.redhat.com/pulp/repos/sghai/dev/content/dist/rhel/server/6/6.2/x86_64/os</url>
      <persisted>No</persisted>
      <clientcert>-----BEGIN CERTIFICATE-----
MIIG1zCCBb+gAwIBAgIIUxwQUGUK+/gwDQYJKoZIhvcNAQEFBQAwgYgxCzAJBgNV
BAYTAlVTMRcwFQYDVQQIEw5Ob3J0aCBDYXJvbGluYTEQMA4GA1UEBxMHUmFsZWln
aDEQMA4GA1UEChMHUmVkIEhhdDERMA8GA1UECxMIQ2xvdWQgQlUxKTAnBgNVBAMT
IHNjcm9wb25vay5sYWIuZW5nLnBucS5yZWRoYXQuY29tMCAXDTEyMDMyMTIxMzk1
OFoYDzIxMTIwMzIxMjEzOTU4WjArMSkwJwYDVQQDEyA4YWMxNDlkNDM2MzMyNGE1
MDEzNjM3MzRhZTA3MDA1ODCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
ALAupjEX0w+ErCcM1lYEfOq/8p9ZsOtNRwi9dP5suJuvzVM3j/HdYf495RIiiq9L
6xGF1fZ2SWoAbDb664LYSmiwXG9LPq6S0CMWt3qzK2XDzhct4yHuIFRDNyi+PNsJ
C1SbUJsJX3XSR9P2vnGt7EJNZgZqX6a2vn5EteajIav+4GUsbOwKoEK6Mphc3gGp
7SQDLNHmtkSS1Ax9nCOxcrBEsMrtjb6J9O2gD3z7p4GkaMsYq319HC3mQZY0i+SC
UQ/EHl6RT7s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YK
KwYBBAGSCAkEBgQWDBQyMDEyLTAzLTIxVDIxOjM5OjU4WjAkBgorBgEEAZIICQQH
BBYMFDIxMTItMDMtMjFUMjE6Mzk6NThaMBEGCisGAQQBkggJBAwEAwwBMDARBgor
BgEEAZIICQQOBAMMATAwEQYKKwYBBAGSCAkECwQDDAExMDQGCisGAQQBkggJBQEE
JgwkZmE2M2I1YjMtYmVmMC00NDQ3LTg4YmQtYzE1N2NhZmNhZDcwMA0GCSqGSIb3
DQEBBQUAA4IBAQBjlkMu6FuGzR1/494nESSbLdHgpH9v5rUmc2sqi9QErQ6xGCOS
vmWRAi+sYRlLYSbpyHqeVhNFHG9A2lGAygbRe+JFdF7eyCIQ9UVBUs25qB50JduH
UHCfcnTcpaYeqgimc0kS8eR4ffsE13zQDFc33SgUAvZ/2YmayTk0rI3wQMnpiokO
245LGAi0S8l2HXFSItMei3y04tTaoI2txRKMHMVIHGhiurAgb0yCdlou/bLPGoAc
wotB/xe7YIC2stt59wqt42Eg6wMcm4L51upVvk+hM3MKuSDvMEot4LalbL4nTkq9
4Hwk53+ScfQOWZ2qg/plCeNoty4uiqSp76sl
-----END CERTIFICATE-----
</clientcert>
      <clientkey>-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAsC6mMRfTD4SsJwzWVgR86r/yn1mw601HCL10/my4m6/NUzeP
8d1h/j3lEiKKr0vrEYXV9nZJagBsNvrrgthKaLBcb0s+rpLQIxa3erMrZcPOFy3j
Ie4gVEM3KL482wkLVJtQmwlfddJH0/a+ca3sQk1mBmpfpra+fkS15qMhq/7gZSxs
7AqgQroymFzeAantJAMs0ea2RJLUDH2cI7FysESwyu2Nvon07aAPfPungaRoyxir
fX0cLeZBljSL5IJRD8QeXpFPuzkdXrCdQupsLsTAFW2si0GI5+6nTLJowxdL02Go
3Kz2MJuIIZubmHknY7R0BwBCMUDTNCOcknVxPwIDAQABAoIBAQCoJk29q0RomjKI
Lqtee3gRwNM6nSrK2P2D7PZ9YZysEpT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T+u
YIvqOF1KT67nHSYLG9xPe1QKUcBoJxAEF9lw7Lmkb22+KeB2b0MQrOh88J5yndmu
JAoSkLYYs5+eQSGj7ZGMTRA5ZkXwatYVfMCk9QAk98q/pnEyqGuIMw==
-----END RSA PRIVATE KEY-----
</clientkey>
    </repository>
  </repositories>
</template>
[root@scroponok ~]#


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