Bug 1250104

Summary: [RFE] pulp-admin tasks list filter output on state and time
Product: Red Hat Satellite Reporter: Peter Vreman <peter.vreman>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1.0CC: bbuckingham, bkearney, bmbouter, cwelton, daviddavis, dkliban, ggainey, ipanova, lpramuk, mhrivnak, pcreech, rchan, ttereshc, xdmoon
Target Milestone: UnspecifiedKeywords: FutureFeature, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-27 09:17:07 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:
Bug Depends On:    
Bug Blocks: 260381, 1122832    

Description Peter Vreman 2015-08-04 14:10:41 UTC
Description of problem:
The output of of pulp-admin tasks lists contains many successful runs of the past days. In many cases the engineer is only interrested in the current running or waiting tasks. And in troubleshooting for Failed tasks. And to limit the output also a filter on the last X day(s).

The current command always retruns everything resulting in 1+MB text output

# pulp-admin tasks list > pulp.tasks.list.`date '+%Y%m%d%H%M'`
# ls -l pulp.tasks.list.*
-rw-r--r-- 1 root root 1301224 Aug  4 13:54 pulp.tasks.list.201508041354

# grep State: $(ls -1 pulp.tasks.list.* | tail -n1) |sort |uniq -c
      2 State:       Running
   3516 State:       Successful
      2 State:       Waiting




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


How reproducible:


Steps to Reproduce:
1. 
Have system with load running for at least a week including 50 RedHat repo syncs for 7 days. 
3. List pulp tasks

Actual results:
All tasks returned for 7 Days


Expected results:
Able to filter State:
- Waiting, Running, Failed, Successful
Able to limit timerange:
- E.g. Last 24h, last 4h


Additional info:

Comment 2 Michael Hrivnak 2015-10-26 17:19:49 UTC
This is done in pulp 2.7.0.

Comment 3 Brad Buckingham 2015-10-26 17:42:30 UTC
Satellite 6.2 is currently targeted to include pulp 2.8.0 or later; therefore, aligning this bug to that release for verification.

Comment 5 Brad Buckingham 2015-10-26 17:49:20 UTC
For anyone that may come across this bugzilla and are unfamiliar with the pulp-admin-client, you may find the following KCS useful:

https://access.redhat.com/solutions/1295653

Comment 6 pulp-infra@redhat.com 2015-10-26 17:55:44 UTC
The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug.

Comment 7 pulp-infra@redhat.com 2015-10-26 17:55:48 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 8 Bryan Kearney 2016-01-04 15:36:33 UTC
moving this to post. Please verify once 2.7 or later is incorporated into the build.

Comment 9 pulp-infra@redhat.com 2016-02-08 19:00:52 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.

Comment 12 Lukas Pramuk 2016-07-25 15:48:24 UTC
VERIFIED.

@satellite-6.2.0-21.1.el7sat.noarch
pulp-admin-client-2.8.3.3-1.el7sat.noarch

# pulp-admin tasks list -h
Command: list
Description: lists tasks queued (waiting) or running on the server

Available Arguments:

  --all, -a   - if specified, all tasks in all states are shown
  --state, -s - comma-separated list of tasks states desired to be shown.
                Example: "running,waiting,canceled,successful,failed". Do not
                include spaces.

>>> new options to filter the output were added

# pulp-admin tasks list --all |sort |uniq -c|grep State:
    111 State:       Successful
      1 State:       Waiting

# pulp-admin tasks list --state waiting  |sort |uniq -c|grep State:
      1 State:       Waiting
# pulp-admin tasks list --state successful  |sort |uniq -c|grep State:
    111 State:       Successful

# pulp-admin tasks list --state waiting,successful  |sort |uniq -c|grep State:
    111 State:       Successful
      1 State:       Waiting

# pulp-admin tasks list |sort |uniq -c|grep State:
      1 State:       Waiting

>>> by default it lists waiting and running tasks only

Comment 14 errata-xmlrpc 2016-07-27 09:17:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1501