Bug 1622151 - "rhui-manager repo add --product_name NAME" adds only one repo from the product
Summary: "rhui-manager repo add --product_name NAME" adds only one repo from the product
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Update Infrastructure for Cloud Providers
Classification: Red Hat
Component: Tools
Version: 3.0.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: 3.0.7
: 3.0.x
Assignee: RHUI Bug List
QA Contact: Radek Bíba
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-24 14:37 UTC by Radek Bíba
Modified: 2019-01-23 18:05 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-01-23 18:05:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:0149 0 None None None 2019-01-23 18:05:17 UTC

Description Radek Bíba 2018-08-24 14:37:32 UTC
Description of problem:
The interactive mode of rhui-manager has the following feature:

r   manage repositories ->
a   add a new Red Hat content repository ->
Import Repositories:
  1  - All in Certificate
  2  - By Product
  3  - By Repository

If you enter 2 and select a product which contains multiple repos, all the repos in the product get imported. For example, with the Atomic certificate and the "Red Hat Enterprise Linux Atomic Host (Debug RPMs) from RHUI" product, I get the following repos:

Red Hat Enterprise Linux Atomic Host (Debug RPMs) from RHUI (aarch64)
Red Hat Enterprise Linux Atomic Host (Debug RPMs) from RHUI (ppc64le)
Red Hat Enterprise Linux Atomic Host (Debug RPMs) from RHUI (s390x)
Red Hat Enterprise Linux Atomic Host (Debug RPMs) from RHUI (x86_64)

(The list is sorted.)

(Note: This must be a recent change in the entitlement as there was just the x86_64 repo in the entitlement not long ago. That's also why I haven't encountered this bug before.)

However, the CLI mode behaves differently. Only the first repo from the product gets added. See here:

# rhui-manager repo add --product_name "Red Hat Enterprise Linux Atomic Host (RPMs) from RHUI"
Loading latest entitled products from Red Hat...
... listings loaded
Successfully added Red Hat Enterprise Linux Atomic Host (RPMs) from RHUI 
[root@rhua ~]# rhui-manager repo list
ID                             :: Repository Name

Red Hat Repositories
--------------------
rhel-atomic-host-rhui-rpms-ppc64le :: Red Hat Enterprise Linux Atomic Host (RPMs) from RHUI (ppc64le)

Custom Repositories
...


Version-Release number of selected component (if applicable):
RHUI 3.0.4

Additional info:
The code (rhui/tools/commands/repo.py) reads:

        repos, products = self.candidate_repo_manager.resolve_undeployed()
        create_me = None
        for key, value in products.items():
            if product_name == key:
                create_me = products[product_name].repos.values()[0]

        cert = self.cert_manager.cert_for_entitlement(create_me.entitlement)
        result = self.pulp.create_redhat_repo(create_me, cert.cert_filename,
                                              self.config.get('rhui', 'repo_sync_frequency'))

Why just [0]?

Comment 5 errata-xmlrpc 2019-01-23 18:05:13 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0149


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