Issue #344


pulp-admin rpm repo content rpm's "--sort" flag not sorting

Added by about 8 years ago. Updated almost 4 years ago.

Start date:
Due date:
Estimated time:
2. Medium
Platform Release:
Sprint Candidate:
Pulp 2


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 --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:

+ This bug was cloned from Bugzilla Bug #896278 +

Actions #1

Updated by mhrivnak about 8 years ago

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.

+ This comment was cloned from Bugzilla #896278 comment 1 +

Actions #2

Updated by about 8 years ago

Sliding this out to 2.3 to be addressed as a bigger story of revisiting criteria specifications in the CLI.

+ This comment was cloned from Bugzilla #896278 comment 2 +

Actions #3

Updated by about 8 years ago

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

+ This comment was cloned from Bugzilla #896278 comment 3 +

Actions #4

Updated by cduryee about 8 years ago

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.

+ This comment was cloned from Bugzilla #896278 comment 4 +

Actions #5

Updated by cduryee about 8 years ago

fixed in pulp 2.6.0-0.2.beta

+ This comment was cloned from Bugzilla #896278 comment 5 +

Actions #6

Updated by about 8 years ago

[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

+ This comment was cloned from Bugzilla #896278 comment 6 +

Actions #7

Updated by bmbouter about 8 years ago

  • Severity changed from Medium to 2. Medium
Actions #8

Updated by rbarlow almost 8 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter almost 4 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF