Bug 907658

Summary: bkr job-list output is neither human-friendly nor shell-friendly
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: command lineAssignee: Amit Saha <asaha>
Status: CLOSED CURRENTRELEASE QA Contact: Qixiang Wan <qwan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.11CC: asaha, dcallagh, ebaak, llim, qwan, rglasz, rmancy
Target Milestone: 0.12Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: CommandLineEnhancement
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-11 04:55:46 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:

Description Dan Callaghan 2013-02-04 22:49:54 UTC
I wanted to use the output of bkr job-list in my shell (to pass on to bkr job-modify) but it returns JSON/Python which I have no easy way to parse in bash. It's also not easy to read for humans, if the list of jobs is more than a handful long.

It would probably make more sense if it output one job id per line (and no count). Then it would be possible to do things like:

    bkr job-modify --retention-tag=scratch $(bkr job-list --mine)

We could also add a --format option like we have for bkr distros-list.

Comment 3 Qixiang Wan 2013-03-27 09:03:59 UTC
Verified with beaker-0.11.3-1.git.210.bda2c22.

new option --format is supported by the updated client command 'job-list':
$ bkr job-list --format=json
["J:8", "J:7", "J:6", "J:5", "J:4", "J:3", "J:2", "J:1"]

$ bkr job-list --format=list
J:8
J:7
J:6
J:5
J:4
J:3
J:2
J:1

$ bkr job-list
["J:8", "J:7", "J:6", "J:5", "J:4", "J:3", "J:2", "J:1"]

Comment 4 Dan Callaghan 2013-04-11 04:55:46 UTC
Beaker 0.12 has been released.