Bug 847091 - The "repo units" command doesn't correctly use the --fields argument
The "repo units" command doesn't correctly use the --fields argument
Status: CLOSED CURRENTRELEASE
Product: Pulp
Classification: Community
Component: user-experience (Show other bugs)
2.0.6
Unspecified Unspecified
unspecified Severity unspecified
: ---
: Sprint 40
Assigned To: Michael Hrivnak
Preethi Thomas
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-09 12:40 EDT by Jay Dobies
Modified: 2013-09-09 12:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-01-09 12:03:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jay Dobies 2012-08-09 12:40:27 EDT
The crux of the problem is that this changed to display all of the unit association information instead of just the metadata. The --fields argument applies to just the metadata, so it's filtering correctly, however the command itself is displaying too much data:

╭─[jdob]─[hinterlands]─[~]─[]─●
╰─➤ pulp-admin repo units rpm --repo-id avengers --fields name
Created:       2012-08-09T12:18:11
Id:            5023e2c38a905b04ed00001a
Metadata:      
  Name: capt
Owner Id:      SYSTEM
Owner Type:    user
Repo Id:       avengers
Unit Id:       c7c67c33-0011-42cf-9650-42dc219bfc00
Unit Type Id:  rpm
Updated:       2012-08-09T12:18:11


It's only showing "name" in metadata, but it looks broken since we still have all the association cruft around it.

I think we need the following changes:

* By default, only display the metadata on a unit, regardless of whether or not --fields is specified.
* Add an extra flag to allow the user to display the association metadata as well.

My rationale is that I don't think most users care about that association data on a regular basis; that's an exception case when they want to see that. They more care about the units themselves. We've heard complaints in the past that there's too much info, so a "--fields name" view of just the names is pretty important towards making eyeballing a repo's contents feasible.
Comment 1 Preethi Thomas 2012-09-27 11:17:25 EDT
failing this
[root@pulp-master ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.328-1.fc17.noarch

So if you give a field that doesn't exist, the output is some whitespace

I am copying the output below. The empty white space after the command is at it displayed in the output

[root@pulp-master ~]# pulp-admin repo units rpm --repo-id pulp --fields test






































































[root@pulp-master ~]#
Comment 2 Jay Dobies 2012-09-27 12:28:33 EDT
I filed a bug to revisit this module entirely because I saw this as well. I can't find that bug now, but this should get addressed along side that reworking of the module.
Comment 3 Jeff Ortel 2012-10-05 17:43:06 EDT
build: 0.331
Comment 4 Preethi Thomas 2012-10-11 16:06:29 EDT
still not fixed
[root@pulp-master ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.331-1.fc17.noarch
[root@pulp-master ~]# 

[root@pulp-master ~]#  pulp-admin rpm repo content rpm --repo-id pulp --fields test




































[root@pulp-master ~]#
Comment 5 Michael Hrivnak 2012-10-15 11:03:01 EDT
False alarm. The fix was not actually in build 0.331, so please retest with the next build.
Comment 6 Jeff Ortel 2012-10-17 12:20:59 EDT
build: 0.332
Comment 7 Preethi Thomas 2012-11-06 07:30:52 EST
verified
[root@preethi ~]# rpm -q pulp-rpm-server
pulp-rpm-server-0.0.335-1.fc17.noarch
[root@preethi ~]# 

[root@preethi ~]# pulp-admin rpm repo content rpm --repo-id pulp --fields name,arch
Arch:         noarch
Name:         gofer

Arch:         noarch
Name:         gofer-package

Arch:         noarch
Name:         grinder

Arch:         x86_64
Name:         m2crypto

Arch:         x86_64
Name:         m2crypto-debuginfo

Arch:         x86_64
Name:         mod_wsgi

Arch:         x86_64
Name:         mod_wsgi-debuginfo

Arch:         noarch
Name:         pulp-admin-client

Arch:         noarch
Name:         pulp-agent

Arch:         noarch
Name:         pulp-builtins-admin-extensions

Arch:         noarch
Name:         pulp-builtins-consumer-extensions

Arch:         noarch
Name:         pulp-consumer-client

Arch:         noarch
Name:         pulp-rpm-admin-client

Arch:         noarch
Name:         pulp-rpm-admin-extensions

Arch:         noarch
Name:         pulp-rpm-agent

Arch:         noarch
Name:         pulp-rpm-consumer-client

Arch:         noarch
Name:         pulp-rpm-consumer-extensions

Arch:         noarch
Name:         pulp-rpm-handlers

Arch:         noarch
Name:         pulp-rpm-plugins

Arch:         noarch
Name:         pulp-rpm-server

Arch:         noarch
Name:         pulp-rpm-yumplugins

Arch:         noarch
Name:         pulp-selinux

Arch:         noarch
Name:         pulp-server

Arch:         noarch
Name:         python-gofer

Arch:         noarch
Name:         python-isodate

Arch:         noarch
Name:         python-oauth2

Arch:         noarch
Name:         python-okaara

Arch:         noarch
Name:         python-pulp-agent-lib

Arch:         noarch
Name:         python-pulp-bindings

Arch:         noarch
Name:         python-pulp-client-lib

Arch:         noarch
Name:         python-pulp-common

Arch:         noarch
Name:         python-pulp-rpm-common

Arch:         noarch
Name:         python-qpid

Arch:         noarch
Name:         python-rhsm

Arch:         noarch
Name:         python-webpy


[root@preethi ~]#
Comment 8 Preethi Thomas 2013-01-09 12:03:54 EST
Pulp v2.0 released

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