Bug 798709 - Katello CLI - promoting only distros should not trigger genpkgmetadata.py
Summary: Katello CLI - promoting only distros should not trigger genpkgmetadata.py
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: katello-agent
Version: 6.0.1
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: Unspecified
Assignee: Bryan Kearney
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-29 16:04 UTC by James Laska
Modified: 2014-03-11 16:44 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-03-11 16:44:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description James Laska 2012-02-29 16:04:36 UTC
Description of problem:

While discussing bug#798706, it seems unnecessary to initiate a repository metadata sync (createrepo) when promoting a changeset that includes *only* distributions.

This bug is intended to track making the 'changset promote' command not initiate a genpkgmetadata.py command.

Version-Release number of selected component (if applicable):
 * candlepin-0.5.22-1.el6.src.rpm
 * katello-0.1.300-1.el6.src.rpm
 * katello-certs-tools-1.0.2-2.el6.src.rpm
 * katello-cli-0.1.100-2.el6.src.rpm
 * katello-configure-0.1.100-7.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.7-1.el6.src.rpm
 * katello-trusted-ssl-cert-1.0-1.src.rpm
 * pulp-0.0.267-2.el6.src.rpm

Steps to Reproduce:

1. katello> changeset create --name '02 - rht distros' --environment Stage
2. katello> changeset update --name "02 - rht distros" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-i386"      
3. katello> changeset update --name "02 - rht distros" --from_product "Red Hat Enterprise Linux Server" --add_distribution "ks-Red Hat Enterprise Linux-Server-6.2-x86_64"
4. katello> changeset promote --name '02 - rht distros'

Actual results:

# The command returns success
Changeset [ 02 - rht distros ] promoted

# However, createrepo is inprogress ... but shouldn't be needed as "distribution" only involves boot images for a product (not packages).
$ ps -wef | grep createrepo
apache    5913 29319  8 05:07 ?        00:03:10 /usr/bin/python -t /usr/share/createrepo/genpkgmetadata.py --database --checksum sha -g /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/x86_64/os/repodata/comps.xml --update /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/x86_64/os
apache    5922 29319  6 05:07 ?        00:02:14 /usr/bin/python -t /usr/share/createrepo/genpkgmetadata.py --database --checksum sha -g /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/i386/os/repodata/comps.xml --update /var/lib/pulp//repos/redhat/Stage/content/dist/rhel/server/6/6Server/i386/os


Expected results:

Changeset [ 02 - rht distros ] promoted
$ ps -wef | grep createrepo
# createrepo is not running

Additional info:

Comment 1 Lukas Zapletal 2012-02-29 16:29:15 UTC
Distro = repository in Pulp. If you want to promote a distro, you are actually promoting a repository. You need to do createrepo. It is not possible to promote a distro without promoting a repositorory. It simply does not make sense.

Katello should never gets into state when repository was promoted, but distro not. This is not possible in Pulp. If you have such a state, it's a bug. Changeset containing a distro without its "own" repository should not be valid and promotable.

Comment 2 Justin Sherrill 2012-02-29 16:39:58 UTC
What about situations where the repo did not have a distro but now it does?  Katello would be in just a situation.  

There is also the situation where the distribution associated with a repo will change in library, such as 6Server.  When a new 6.Y is released, the distribution in the 6Server repo will change from 6.Y-1 to 6.Y.

Comment 3 Lukas Zapletal 2012-02-29 17:56:45 UTC
We currently do not allow promoting of distros without repos in the CLI:

Validation failed: Repository of the distribution 'ks-Test Family-TestVariant-16-x86_64' has not been promoted into the target environment!

Comment 4 James Laska 2012-02-29 18:15:38 UTC
(In reply to comment #3)
> We currently do not allow promoting of distros without repos in the CLI:

I believe I did that on the command-line (see steps to reproduce in comment#0).  Am I misunderstanding?

Comment 5 Justin Sherrill 2012-02-29 18:20:33 UTC
lzap that error simply states that the repo is not already promoted, not that the repo must be promoted with the distro.

Comment 6 Justin Sherrill 2012-02-29 18:22:06 UTC
All subcontent (packages, errata, distros) must have the repo promoted before promoting them.  This does not mean they cannot be promoted by themselves.  As james said, the cli does support promoting distros, the repo just has to have already been promoted at some point.

Comment 10 Lukas Zapletal 2012-03-01 08:38:25 UTC
Justin I understand when .treeinfo changes we would need to repromote distro only.

But again - this is not possible in Pulp. Distributions do not live on their own there.

Promotion = repo clone in Pulp. And repo cloning is the only way of getting Distribution object (what we see in Katello) promoted.

Now, correct me if I am wrong, but I say: It is not possible to promote a distribution without generating metadata. Because to promote a distribution you need to promote whole repository (e.g. distributions, packages, everything there).

Comment 11 Tomas Strachota 2012-03-01 08:54:49 UTC
Lukas,
what you say is true only for first promotion. Second time and on the actual repo is already cloned in Pulp and you can update the distribution alone.

Comment 12 Justin Sherrill 2012-03-01 14:58:43 UTC
We had a discussion in irc but to clarify:

(In reply to comment #10)
> Justin I understand when .treeinfo changes we would need to repromote distro
> only.
> 
> But again - this is not possible in Pulp. Distributions do not live on their
> own there.
> 
> Promotion = repo clone in Pulp. And repo cloning is the only way of getting
> Distribution object (what we see in Katello) promoted.

Not exactly.  A promotion could result in a repo clone, but that's only in the case of repo or product promotion.  Package, errata, or distribution promotion does not result in a repo clone.
 


> Now, correct me if I am wrong, but I say: It is not possible to promote a
> distribution without generating metadata. Because to promote a distribution you
> need to promote whole repository (e.g. distributions, packages, everything
> there).

It is possible.  Pulp has an add_distribution api call that we are using.  I am presuming this functions as we intend.

Comment 13 Lukas Zapletal 2012-03-01 16:24:50 UTC
Ok I think I understand where the problem is now. Ok this is 1.1 one.

Comment 14 Mike McCune 2013-08-16 18:00:49 UTC
getting rid of 6.0.0 version since that doesn't exist

Comment 17 Bryan Kearney 2014-03-11 16:44:11 UTC
Closing old bugs which are not relevant based on new UI and CLI


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