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 1188781

Summary: pulp-admin line wrapping makes output difficult to parse
Product: Red Hat Satellite Reporter: Frank Hirtz <fhirtz>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: low    
Version: 6.0.0CC: bbuckingham, bkearney, erik-fedora, lpramuk, mhrivnak, pmoravec
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-04 13:48:24 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:

Description Frank Hirtz 2015-02-03 17:08:19 UTC
Description of problem:

I don't think that this is unique to pulp-admin, but my report is specifically for that. Anyway, pulp-admin automatically linewraps output, which is pretty, but makes it difficult to parse and make use of the data that it outputs since it's often truncated and completed on multiple lines. Since we use excessively long labels by default, it makes it quite difficult to work with:

<snip>
[root@garabaldi pulp]# pulp-admin repo list --details  | head -n 20
+------------------------------------------------------------------------------+
                                 Repositories
+------------------------------------------------------------------------------+

Id:                  Maunet_org-Red_Hat_Enterprise_Linux_Server-Red_Hat_Enterprise_Linux_6_Serv
                     er_-_Extras_RPMs_x86_64
Display Name:        Red Hat Enterprise Linux 6 Server - Extras RPMs x86_64
Description:         None
Content Unit Counts: 
  Erratum: 4
  Rpm:     13
Notes:               
Importers:           
  Config:           
    Feed:            https://cdn.redhat.com/content/dist/rhel/server/6/6Server/x86_64/extras/os
    SSL CA Cert:     -----BEGIN CERTIFICATE-----
                     MIIG/TCCBOWgAwIBAgIBNzANBgkqhkiG9w0BAQUFADCBsTELMAkGA1UEBhMCVVMx
                     FzAVBgNVBAgMDk5vcnRoIENhcm9saW5hMRYwFAYDVQQKDA1SZWQgSGF0LCBJbmMu
                     MRgwFgYDVQQLDA9SZWQgSGF0IE5ldHdvcmsxMTAvBgNVBAMMKFJlZCBIYXQgRW50
                     aXRsZW1lbnQgT3BlcmF0aW9ucyBBdXRob3JpdHkxJDAiBgkqhkiG9w0BCQEWFWNh
...
</snip>

This makes human parsing a bit challenging at times and makes automatic parsing of the output quite difficult. It also breaks format of SSL CA Cert keys.

One can work around this in an ugly way by specifying:

wrap_to_terminal = false
wrap_width = <some arbitrary long value longer than the longest field>

...which is unappealing, and also has us create really, really long dividers and the like in our attempt to prettify the output. I put a hack in to limit the dividers to 80 characters, but that's not really a fix. It'd be nice if we could just disable line-wrapping as an option here.


Version-Release number of selected component (if applicable):
pulp-admin-client-2.4.3-1.el7sat.noarch

Comment 2 Lukas Pramuk 2015-03-17 11:19:10 UTC
pulp-admin has harcoded line wrapping at 80 chars even if you redirect output into a file.

it ignores terminal settings at all :-/

Comment 3 Frank Hirtz 2015-03-17 13:08:18 UTC
For the client, I ended up doing this:


wrap_to_terminal = false
wrap_width = 20000

That's hackish, and it ends up with a really long title and dividers (they set the output of those to the width, which doesn't work so well for us here). I hacked in a quick sanity check on those for testing:

<snip>
[root@garabaldi client]# diff -uNr /usr/lib/python2.7/site-packages/pulp/client/extensions/core.py.orig /usr/lib/python2.7/site-packages/pulp/client/extensions/core.py
--- /usr/lib/python2.7/site-packages/pulp/client/extensions/core.py.orig        2014-12-04 13:24:39.095639100 -0500
+++ /usr/lib/python2.7/site-packages/pulp/client/extensions/core.py     2014-12-04 13:33:02.174349751 -0500
@@ -114,9 +114,13 @@
             width = self.wrap_width

         width = int(math.floor(TITLE_PERCENTAGE * width))
-        divider = '+' + ('-' * (width - 2)) + '+'
+       if width > 80:
+               dividerwidth = 78
+       else:
+               dividerwidth = (width - 2)
+        divider = '+' + ('-' * dividerwidth) + '+'

-        title = self.center(title, width=width)
+        title = self.center(title, width=dividerwidth)

         self.write(divider)
         # self.write(title, color=COLOR_HEADER, tag=TAG_TITLE) # removing color for now
</snip>

...but that's just a hack.

Comment 4 pulp-infra@redhat.com 2015-04-29 18:00:19 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 5 pulp-infra@redhat.com 2015-04-29 18:00:20 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 6 Brian Bouterse 2015-04-29 19:28:09 UTC
Adding mhrivnak to cc list

Comment 7 Brian Bouterse 2015-04-29 19:28:56 UTC
Adding bbouters to cc list

Comment 8 Michael Hrivnak 2015-10-02 13:27:29 UTC
pulp-admin needs a lot of work to make its output machine-parsable. The line wrapping is just one of numerous issues (changing capitalization, incorrect exit codes, etc).

Upstream, we would much rather replace pulp-admin completely with a new tool that is less cumbersome to use, and easier for both machines and humans to interact with. There are lots of ideas about this, but I don't anticipate being able to prioritize it until after pulp 3.0.

Since pulp-admin is not part of the core product, I suggest making this low priority relative to other satellite requirements. We can do it if necessary, but given a long list of other requirements, I suspect our time is better spent on other areas.

Comment 10 Pavel Moravec 2016-02-03 09:19:58 UTC
*** Bug 1299524 has been marked as a duplicate of this bug. ***

Comment 11 Bryan Kearney 2016-07-08 20:42:08 UTC
Per 6.3 planning, moving out non acked bugs to the backlog

Comment 13 Bryan Kearney 2016-10-04 13:48:24 UTC
We have reported this bug upstream, and will deliver the fix when it is available. Since pulp-admin is not part of the core product, we are not planning on tracking this particular feature.

Comment 14 Brad Buckingham 2016-11-28 16:49:26 UTC
The upstream issue to track the resolution is https://pulp.plan.io/issues/929.