Bug 798709 - Katello CLI - promoting only distros should not trigger genpkgmetadata.py
Katello CLI - promoting only distros should not trigger genpkgmetadata.py
Status: CLOSED WONTFIX
Product: Red Hat Satellite 6
Classification: Red Hat
Component: katello-agent (Show other bugs)
6.0.1
Unspecified Unspecified
low Severity low (vote)
: Unspecified
: --
Assigned To: Bryan Kearney
Katello QA List
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-29 11:04 EST by James Laska
Modified: 2014-03-11 12:44 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-11 12:44:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James Laska 2012-02-29 11:04:36 EST
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 11:29:15 EST
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 11:39:58 EST
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 12:56:45 EST
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 13:15:38 EST
(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 13:20:33 EST
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 13:22:06 EST
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 03:38:25 EST
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 03:54:49 EST
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 09:58:43 EST
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 11:24:50 EST
Ok I think I understand where the problem is now. Ok this is 1.1 one.
Comment 14 Mike McCune 2013-08-16 14:00:49 EDT
getting rid of 6.0.0 version since that doesn't exist
Comment 17 Bryan Kearney 2014-03-11 12:44:11 EDT
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.