Bug 896278 - pulp-admin rpm repo content rpm's "--sort" flag not sorting
Summary: pulp-admin rpm repo content rpm's "--sort" flag not sorting
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.0.6
Hardware: All
OS: Linux
Target Milestone: ---
: 2.6.0
Assignee: Michael Hrivnak
QA Contact: Preethi Thomas
Depends On:
TreeView+ depends on / blocked
Reported: 2013-01-16 23:04 UTC by Steven Roberts
Modified: 2015-02-28 21:54 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-02-28 21:54:22 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Pulp Redmine 344 None None None Never

Description Steven Roberts 2013-01-16 23:04:16 UTC
Description of problem:
"pulp-admin rpm repo content rpm" --sort is not sorting.  in fact it looks to be removing the sorting.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. create a repo, for example pulp el6 RPMs:
pulp-admin rpm repo create --repo-id pulp-el6 --relative-url rhels6/pulp --feed http://repos.fedorapeople.org/repos/pulp/pulp/v2/beta/6/x86_64/ --skip drpm 

2. sync it
3. run without a --sort flag:
pulp-admin rpm repo content rpm --repo-id pulp-el6 --fields name,version,release,arch
4. run with a --sort flag:
pulp-admin rpm repo content rpm --repo-id pulp-el6 --sort name,ascending --fields name,version,release,arch
Actual results:
--sort produces unsorted output

Expected results:
--sort name (with or without the ,ascending) would cause the output to be sorted by name

Additional info:

Comment 1 Michael Hrivnak 2013-01-16 23:10:51 UTC
Looking in ~/.pulp/server_calls.log, it seems that the CLI is specifying that the requested sort field be applied to the association, not to the content unit. Since the association doesn't have a "name" field, no sorting is applied.

By default, we only show the content unit attributes and not the association attributes, so it is confusing to sort on the ones that are hidden by default.

Comment 2 Jay Dobies 2013-04-01 17:44:57 UTC
Sliding this out to 2.3 to be addressed as a bigger story of revisiting criteria specifications in the CLI.

Comment 3 Peter Hehn 2013-04-03 17:36:42 UTC
A closely related issue I think - when any sort field is added to a query for puppet modules, it breaks entirely giving the following error in admin.log...

pulp-admin puppet repo modules --repo-id=myrepo --str-eq name=mymodulename --str-eq author=me --fields=name,version --sort=version

  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/core.py", line 478, in run
    exit_code = Cli.run(self, args)
  File "/usr/lib/python2.6/site-packages/okaara/cli.py", line 921, in run
    exit_code = command_or_section.execute(self.prompt, remaining_args)
  File "/usr/lib/python2.6/site-packages/pulp/client/extensions/extensions.py", line 224, in execute
    return self.method(*arg_list, **clean_kwargs)
  File "/usr/lib/python2.6/site-packages/pulp_puppet/extensions/admin/repo/modules.py", line 46, in run
    map(lambda x : x['metadata'].pop('checksums', None), modules)
  File "/usr/lib/python2.6/site-packages/pulp_puppet/extensions/admin/repo/modules.py", line 46, in <lambda>
    map(lambda x : x['metadata'].pop('checksums', None), modules)
AttributeError: 'NoneType' object has no attribute 'pop'

Comment 4 Chris Duryee 2014-11-11 21:57:12 UTC
The scenarios in the original bugzilla entry and in comment #3 work for me on pulp 2.4.3.

Marking BZ as MODIFIED for 2.5.1.

Comment 5 Chris Duryee 2014-12-23 20:52:20 UTC
fixed in pulp 2.6.0-0.2.beta

Comment 6 Preethi Thomas 2015-01-27 20:36:17 UTC
[root@cloud-qe-4 ~]# rpm -qa pulp-server
[root@cloud-qe-4 ~]# 

Tested the original issue and comment#3

[root@cloud-qe-4 ~]# pulp-admin puppet repo modules --repo-id=repo1 --str-eq author=puppetlabs --fields=name,version --sort=version
Name:    logentries
Version: 0.0.1

Name:    kwalify
Version: 0.0.1

Name:    vcli_rsyslog
Version: 0.0.1

Name:    sqlite
Version: 0.0.1

Name:    node_gce
Version: 0.0.1

Name:    appdirector
Version: 0.0.1

Name:    lib_puppet
Version: 0.0.1

Name:    mount_providers
Version: 0.0.2

Name:    cloudformation
Version: 0.0.2

Name:    newrelic
Version: 0.0.3

Name:    node_openstack
Version: 0.0.4

Name:    dashboard
Version: 0.0.4

Name:    drbd
Version: 0.1.0

Name:    stunnel
Version: 0.1.0

Name:    transition
Version: 0.1.0

Name:    pe_gem
Version: 0.1.0

Name:    strings
Version: 0.1.1

Name:    awsdemo_profiles
Version: 0.1.1

Name:    reboot
Version: 0.1.9

Name:    mongodb
Version: 0.10.0

Name:    razor
Version: 0.11.0

Name:    gcc
Version: 0.2.0

Name:    aws
Version: 0.2.0

Name:    tftp
Version: 0.2.2

Name:    git
Version: 0.3.0

Name:    vswitch
Version: 0.3.0

Name:    dhcp
Version: 0.3.0

Name:    lvm
Version: 0.4.0

Name:    ruby
Version: 0.4.0

Name:    gce_compute
Version: 0.5.0

Name:    nodejs
Version: 0.7.1

Name:    registry
Version: 1.0.3

Name:    powershell
Version: 1.0.4

Name:    acl
Version: 1.0.4

Name:    haproxy
Version: 1.1.0

Name:    dism
Version: 1.1.0

Name:    grizzly
Version: 1.1.1

Name:    concat
Version: 1.1.2

Name:    cloud_provisioner
Version: 1.1.4

Name:    vcsrepo
Version: 1.2.0

Name:    apache
Version: 1.2.0

Name:    inifile
Version: 1.2.0

Name:    motd
Version: 1.2.0

Name:    firewall
Version: 1.3.0

Name:    java
Version: 1.3.0

Name:    boundary
Version: 1.3.0

Name:    xinetd
Version: 1.4.0

Name:    apt
Version: 1.7.0

Name:    mcollective
Version: 2.0.0

Name:    pe_upgrade
Version: 2.1.1

Name:    tempest
Version: 3.0.0

Name:    mysql
Version: 3.1.0

Name:    splunk
Version: 3.1.1

Name:    ntp
Version: 3.3.0

Name:    postgresql
Version: 4.1.0

Name:    puppetdb
Version: 4.1.0

Name:    ceilometer
Version: 4.2.0

Name:    keystone
Version: 4.2.0

Name:    horizon
Version: 4.2.0

Name:    heat
Version: 4.2.0

Name:    cinder
Version: 4.2.0

Name:    nova
Version: 4.2.0

Name:    neutron
Version: 4.3.0

Name:    stdlib
Version: 4.5.1

Name:    openstack
Version: 5.0.1

Name:    nginx
Version: 99.99.99

Comment 7 Brian Bouterse 2015-02-28 21:54:22 UTC
Moved to https://pulp.plan.io/issues/344

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