Bug 1066269 - bkr job-watch crashes when watching recipe or task: KeyError: 'name'
Summary: bkr job-watch crashes when watching recipe or task: KeyError: 'name'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Beaker
Classification: Retired
Component: command line
Version: 0.14
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: 0.17
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-18 07:45 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-10 23:28:01 UTC
Embargoed:


Attachments (Terms of Use)

Description Dan Callaghan 2014-02-18 07:45:11 UTC
Description of problem:
bkr job-watch crashes if you tell it to watch a recipe (e.g. R:123) or a task (e.g. T:123).

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

How reproducible:
always

Steps to Reproduce:
1. Run bkr job-watch R:123 or bkr job-watch T:123

Actual results:
Watching tasks (this may be safely interrupted)...
Traceback (most recent call last):
  File "/usr/bin/bkr", line 9, in <module>
    load_entry_point('bkr.client==0.15.2', 'console_scripts', 'bkr')()
  File "/usr/lib/python2.6/site-packages/bkr/client/main.py", line 58, in main
    return cmd.run(*cmd_args, **cmd_opts.__dict__)
  File "/usr/lib/python2.6/site-packages/bkr/client/commands/cmd_job_watch.py", line 87, in run
    sys.exit(watch_tasks(self.hub, args))
  File "/usr/lib/python2.6/site-packages/bkr/client/task_watcher.py", line 37, in watch_tasks
    changed |= watcher.update(task)
  File "/usr/lib/python2.6/site-packages/bkr/client/task_watcher.py", line 108, in update
    print "%s: %s" % (task, task.display_state(task.task_info))
  File "/usr/lib/python2.6/site-packages/bkr/client/task_watcher.py", line 142, in display_state
    return "%s (%s)" % (task_info["state_label"], worker["name"])
KeyError: 'name'

Expected results:
Should watch the given recipe or task.

Additional info:
Watching a job or recipeset works correctly.

Comment 2 Nick Coghlan 2014-02-18 08:22:34 UTC
Discussing this with Dan, it appears that this broke quite some time ago, and nobody noticed because it tends to be used to watch entire jobs, not their individual components.

Comment 3 Dan Callaghan 2014-05-21 05:35:42 UTC
This was actually a regression in Beaker 0.14.4 due to the fix for bug 1032653.

http://git.beaker-project.org/cgit/beaker/commit/?id=c9eb0409

The fix should have been return None for 'worker' rather than {}.

Comment 4 Dan Callaghan 2014-05-21 05:38:49 UTC
On Gerrit: http://gerrit.beaker-project.org/3093

Comment 7 Dan Callaghan 2014-06-02 04:39:53 UTC
This bug fix has been applied to the release-0.16 branch, however we have elected not to do another maintenance release of the 0.16.x series. This fix will be included in 0.17.0 instead.

Comment 8 Dan Callaghan 2014-06-10 23:28:01 UTC
Beaker 0.17.0 has been released.


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