Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1415661

Summary: [Patch] Build cert and client config rpm at once with 'client rpm' command of rhui-manager
Product: Red Hat Update Infrastructure for Cloud Providers Reporter: Satoru SATOH <ssato>
Component: ToolsAssignee: RHUI Bug List <rhui-bugs>
Status: CLOSED ERRATA QA Contact: Vratislav Hutsky <vhutsky>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.0.0CC: bkearney, mkubik
Target Milestone: 3.0.7   
Target Release: 3.0.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-23 18:05:13 UTC Type: Bug
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: 1428756    
Bug Blocks:    
Attachments:
Description Flags
An experimental patch to add '--cert' option along with other related ones to 'client rpm' command of rhui-manager, to generate cert also before building clint config rpm none

Description Satoru SATOH 2017-01-23 11:39:35 UTC
Created attachment 1243554 [details]
An experimental patch to add '--cert' option along with other related ones to 'client rpm' command of rhui-manager, to generate cert also before building clint config rpm

Description of problem:
To build client config rpms, users have to do a pair of steps with rhui-manager client commands:

1. generate client entitlement cert (rhui-manager client cert)
2. build client config rpm (rhui-manager client rpm)

And typical cases, these steps are performed sequentially and
no reasons to split the job into these two steps frankly, IMHO.

I made an experimental patch to perform these two steps at once
with 'client rpm' command of rhui-manager optionally.

Version-Release number of selected component (if applicable): RHUI 3.0 Beta.2

How reproducible: Always

Additional info:

Example session log by the patch:

[root@rhua-3-1 site-packages]# ls /tmp/3
ls: cannot access /tmp/3: No such file or directory
[root@rhua-3-1 site-packages]# rhui-manager client rpm --help                   Usage: rhui-manager [options]

Options:
  -h, --help            show this help message and exit
rpm: create a client config rpm
    --private_key - entitlement private key
    --entitlement_cert - entitlement certificate
    --rpm_version - version number of the client config rpm
    --rpm_name - name of the client config rpm (required)
    --dir - directory where the rpm will be created (required)
    --unprotected_repos - comma-separated list of unprotected repos to include
    --cert - Generate certificate also before building client config rpm if given
    --repo_label - identifies the repositories to add. Comma delimited string of repo labels
    --name - identifies the certificate name if it is different from rpm name
    --days - number of days cert will be valid
[root@rhua-3-1 site-packages]# rhui-manager client rpm --rpm_name rhel-7-rhui-client-config --dir /tmp/3 --cert --repo_label rhel-7-server-rhui-rpms
Try to generate cert also ...
.................+++
...+++
Entitlement certificate created at /tmp/3/rhel-7-rhui-client-config.crt
Successfully created client configuration RPM.
RPMs can be found at /tmp/3
[root@rhua-3-1 site-packages]# ls /tmp/3/
rhel-7-rhui-client-config-2.0  rhel-7-rhui-client-config-extensions.txt
rhel-7-rhui-client-config.crt  rhel-7-rhui-client-config.key
rhel-7-rhui-client-config.csr
[root@rhua-3-1 site-packages]# ls /tmp/3/rhel-7-rhui-client-config-2.0/build/RPMS/noarch/
rhel-7-rhui-client-config-2.0-1.noarch.rpm
[root@rhua-3-1 site-packages]# rpm -qlp /tmp/3/rhel-7-rhui-client-config-2.0/build/RPMS/noarch/rhel-7-rhui-client-config-2.0-1.noarch.rpm
/etc/pki/rhui/ca.crt
/etc/pki/rhui/key.pem
/etc/pki/rhui/product/content.crt
/etc/yum.repos.d/rh-cloud.repo
[root@rhua-3-1 site-packages]#

Comment 6 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