Project

Profile

Help

Story #929

closed

As a user, I can machine-parse pulp-admin output

Added by bkearney@redhat.com over 9 years ago. Updated over 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

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


Related issues

Has duplicate Pulp - Story #205: [RFE] add option to make pulp-admin output machine-readableCLOSED - DUPLICATE

Actions
Has duplicate Pulp - Issue #1696: pulp-admin's line wrapping makes it difficult to process its output without using my soft, human brainCLOSED - DUPLICATEActions

Also available in: Atom PDF