Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 2013712

Summary: --quiet option of satellite-maintain content prepare command, doesn't return any output for the migration steps
Product: Red Hat Satellite Reporter: Gaurav Talreja <gtalreja>
Component: Satellite MaintainAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Gaurav Talreja <gtalreja>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.9.0CC: apatel, ehelms, iballou, jsherril, kgaikwad, osousa
Target Milestone: 6.9.7Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.18.1.45-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-10 16:20:48 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:    
Bug Blocks: 1945650    

Description Gaurav Talreja 2021-10-13 15:28:45 UTC
Description of problem:
From BZ 1945650, --quiet option of "satellite-maintain content prepare" command, doesn't return any output for the migration steps, instead, it should return single line output for migration steps like before this fix, see https://bugzilla.redhat.com/show_bug.cgi?id=1945650#c6

Version-Release number of selected component (if applicable):
Satellite 6.9.7 Snap 1.0
rubygem-foreman_maintain-0.7.14

How reproducible:
Always

Steps to Reproduce:
1. Prepare a 6.9.7 setup with any RH/large repos to see this behavior.
2. # satellite-maintain prep-6.10-upgrade
3. # satellite-maintain content prepare --quiet

Actual results:
--quiet returns nothings for output.

Expected results:
--quiet should return single line output.

Additional info:

Comment 1 Ian Ballou 2021-10-14 16:16:38 UTC
I'm seeing the output with --quiet but it seems it is only printed until the rake task is completely done.  For example, it'll be stuck on "Prepare content for Pulp 3:" and then at the very end it will print the following all together:

```
Checking for valid Katello configuraton.
Starting task.
2021-10-14 16:14:18 +0000: Content migration starting. 
Content Migration completed successfully

Checking for valid Katello configuraton.
Starting task.
2021-10-14 16:14:18 +0000: Content migration starting. 
Content Migration completed successfully
                             [OK]
```

The same thing happens if I revert my PR that introduced the --quiet option so I'm guessing the regression occurred in a later commit.

Comment 2 Ian Ballou 2021-10-14 18:28:47 UTC
If I hit ctrl-c when "Prepare content for Pulp 3:" is up, then I finally see the output before the foreman-maintain process is killed.

Comment 3 Ian Ballou 2021-10-14 19:30:03 UTC
The output also seems to be duplicated:

--------------------------------------------------------------------------------
Prepare content for Pulp 3: 
Checking for valid Katello configuraton.
Starting task.

2021-10-14 19:21:16 +0000: Content migration starting. 
2021-10-14 19:21:26 +0000: Pre-migrating Pulp 2 rpm content (general info) 4000/10104
2021-10-14 19:21:36 +0000: Pre-migrating Pulp 2 rpm content (general info) 9000/10104
2021-10-14 19:21:46 +0000: Migrating rpm content to Pulp 3 1001/10104
2021-10-14 19:21:56 +0000: Migrating rpm content to Pulp 3 2001/10104
2021-10-14 19:22:06 +0000: Migrating rpm content to Pulp 3 3001/10104
2021-10-14 19:22:16 +0000: Migrating rpm content to Pulp 3 6001/10104
2021-10-14 19:22:26 +0000: Migrating rpm content to Pulp 3 7001/10104
2021-10-14 19:22:36 +0000: Migrating rpm content to Pulp 3 8001/10104
2021-10-14 19:22:46 +0000: Migrating distribution content to Pulp 3 0/1
2021-10-14 19:22:56 +0000: Distribution creation 1/2
2021-10-14 19:23:06 +0000: Distribution creation 1/2
2021-10-14 19:23:16 +0000: Importing migrated content type rpm: 360/10104
2021-10-14 19:23:26 +0000: Importing migrated content type rpm: 1170/10104
2021-10-14 19:23:36 +0000: Importing migrated content type rpm: 2070/10104
2021-10-14 19:23:46 +0000: Importing migrated content type rpm: 2790/10104
2021-10-14 19:23:56 +0000: Importing migrated content type rpm: 3600/10104
2021-10-14 19:24:06 +0000: Importing migrated content type rpm: 4410/10104
2021-10-14 19:24:16 +0000: Importing migrated content type rpm: 5220/10104
2021-10-14 19:24:26 +0000: Importing migrated content type rpm: 6030/10104
2021-10-14 19:24:36 +0000: Importing migrated content type rpm: 6840/10104
2021-10-14 19:24:46 +0000: Importing migrated content type rpm: 7650/10104
2021-10-14 19:24:56 +0000: Importing migrated content type rpm: 8550/10104
2021-10-14 19:25:06 +0000: Importing migrated content type rpm: 9360/10104
2021-10-14 19:25:16 +0000: Importing migrated content type rpm: 10104/10104
Content Migration completed successfully

Checking for valid Katello configuraton.
Starting task.

2021-10-14 19:21:16 +0000: Content migration starting. 
2021-10-14 19:21:26 +0000: Pre-migrating Pulp 2 rpm content (general info) 4000/10104
2021-10-14 19:21:36 +0000: Pre-migrating Pulp 2 rpm content (general info) 9000/10104
2021-10-14 19:21:46 +0000: Migrating rpm content to Pulp 3 1001/10104
2021-10-14 19:21:56 +0000: Migrating rpm content to Pulp 3 2001/10104
2021-10-14 19:22:06 +0000: Migrating rpm content to Pulp 3 3001/10104
2021-10-14 19:22:16 +0000: Migrating rpm content to Pulp 3 6001/10104
2021-10-14 19:22:26 +0000: Migrating rpm content to Pulp 3 7001/10104
2021-10-14 19:22:36 +0000: Migrating rpm content to Pulp 3 8001/10104
2021-10-14 19:22:46 +0000: Migrating distribution content to Pulp 3 0/1
2021-10-14 19:22:56 +0000: Distribution creation 1/2
2021-10-14 19:23:06 +0000: Distribution creation 1/2
2021-10-14 19:23:16 +0000: Importing migrated content type rpm: 360/10104
2021-10-14 19:23:26 +0000: Importing migrated content type rpm: 1170/10104
2021-10-14 19:23:36 +0000: Importing migrated content type rpm: 2070/10104
2021-10-14 19:23:46 +0000: Importing migrated content type rpm: 2790/10104
2021-10-14 19:23:56 +0000: Importing migrated content type rpm: 3600/10104
2021-10-14 19:24:06 +0000: Importing migrated content type rpm: 4410/10104
2021-10-14 19:24:16 +0000: Importing migrated content type rpm: 5220/10104
2021-10-14 19:24:26 +0000: Importing migrated content type rpm: 6030/10104
2021-10-14 19:24:36 +0000: Importing migrated content type rpm: 6840/10104
2021-10-14 19:24:46 +0000: Importing migrated content type rpm: 7650/10104
2021-10-14 19:24:56 +0000: Importing migrated content type rpm: 8550/10104
2021-10-14 19:25:06 +0000: Importing migrated content type rpm: 9360/10104
2021-10-14 19:25:16 +0000: Importing migrated content type rpm: 10104/10104
Content Migration completed successfully
                             [OK]
--------------------------------------------------------------------------------

Comment 5 Justin Sherrill 2021-10-29 21:27:50 UTC
This should be fixed in  tfm-rubygem-katello-3.18.1.45-1.el7sat.noarch  or later, resolved by https://gitlab.sat.engineering.redhat.com/satellite6/katello/-/commit/b00734103e626b6c0e0956d9e7a86d27ca1ffbe2

Moving to post, but it can probably be moved to modified?

Comment 6 Gaurav Talreja 2021-11-02 14:15:50 UTC
Verified.

Tested on Satellite 6.9.7 Snap 3.0
Version: rubygem-foreman_maintain-0.7.14-1.el7sat.noarch

Steps:
1. satellite-maintain content prepare --quiet

Observation:
--quiet option keeps the previous behavior of keeping the output of content migration on a single line.

Comment 9 errata-xmlrpc 2021-11-10 16:20:48 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 (Satellite Maintenance 6.9.7 Async Bug Fix Update), 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-2021:4611