hdparm job fails with KeyError: 'description'

Bug #832351 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
Medium
Daniel Manrique

Bug Description

Checkbox 0.12.4 on Ubuntu Oneiric with the image from 20110823.

If the info/hdparm job, defined in jobs/info.txt is added to a whitelist, it fails with the following trace:

2011-08-23 16:46:27,760 DEBUG Calling ./plugins/persist_info.py PersistInfo.save(<checkbox_gtk.gtk_interface.GTKInterface object at 0x225e990>, {'status': 'unini
tiated', 'command': 'cat <<\'EOF\' | run_templates -t -s \'udev_resource | filter_templates -w "category=DISK"\'\nplugin: attachment\nname: info/hdparm_`ls /sys$path/bl
ock`.txt\nrequires: device.path == "$path"\nuser: root\ncommand: hdparm -I /dev/`ls /sys$path/block`\nEOF', 'name': 'info/hdparm', 'plugin': 'local', 'suite': '__info__
', 'type': 'suite', 'requires': ["package.name == 'hdparm'", "device.category == 'DISK'"]}) for prompt-job with priority -100.
2011-08-23 16:46:27,760 DEBUG Calling ./plugins/resource_info.py ResourceInfo.prompt_job(<checkbox_gtk.gtk_interface.GTKInterface object at 0x225e990>, {'status'
: 'uninitiated', 'command': 'cat <<\'EOF\' | run_templates -t -s \'udev_resource | filter_templates -w "category=DISK"\'\nplugin: attachment\nname: info/hdparm_`ls /sys
$path/block`.txt\nrequires: device.path == "$path"\nuser: root\ncommand: hdparm -I /dev/`ls /sys$path/block`\nEOF', 'name': 'info/hdparm', 'plugin': 'local', 'suite': '
__info__', 'type': 'suite', 'requires': ["package.name == 'hdparm'", "device.category == 'DISK'"]}) for prompt-job with priority -10.
2011-08-23 16:46:27,762 DEBUG Calling ./plugins/jobs_prompt.py JobsPrompt.prompt_job(<checkbox_gtk.gtk_interface.GTKInterface object at 0x225e990>, {'status': 'u
ninitiated', 'command': 'cat <<\'EOF\' | run_templates -t -s \'udev_resource | filter_templates -w "category=DISK"\'\nplugin: attachment\nname: info/hdparm_`ls /sys$pat
h/block`.txt\nrequires: device.path == "$path"\nuser: root\ncommand: hdparm -I /dev/`ls /sys$path/block`\nEOF', 'name': 'info/hdparm', 'plugin': 'local', 'suite': '__in
fo__', 'type': 'suite', 'requires': ["package.name == 'hdparm'", "device.category == 'DISK'"], 'resources': [{'status': 'Installed', 'desired': 'Install', 'version': '9
.32-1ubuntu3', 'name': 'hdparm', 'description': 'tune hard disk parameters for high performance'}, {'category': 'DISK', 'product': 'SAMSUNG HM641JI', 'vendor': 'ATA', '
bus': 'scsi', 'driver': 'sd', 'path': '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0'}]}) for prompt-job with priority 0.
2011-08-23 16:46:27,763 ERROR Error running event handler ./plugins/jobs_prompt.py JobsPrompt.prompt_job(<checkbox_gtk.gtk_interface.GTKInterface object at 0x225e990>, {'status': 'uninitiated', 'command': 'cat <<\'EOF\' | run_templates -t -s \'udev_resource | filter_templates -w "category=DISK"\'\nplugin: attachment\nname: info/hdparm_`ls /sys$path/block`.txt\nrequires: device.path == "$path"\nuser: root\ncommand: hdparm -I /dev/`ls /sys$path/block`\nEOF', 'name': 'info/hdparm', 'plugin': 'local', 'suite': '__info__', 'type': 'suite', 'requires': ["package.name == 'hdparm'", "device.category == 'DISK'"], 'resources': [{'status': 'Installed', 'desired': 'Install', 'version': '9.32-1ubuntu3', 'name': 'hdparm', 'description': 'tune hard disk parameters for high performance'}, {'category': 'DISK', 'product': 'SAMSUNG HM641JI', 'vendor': 'ATA', 'bus': 'scsi', 'driver': 'sd', 'path': '/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0'}]}) for event type 'prompt-job'
Traceback (most recent call last):
  File "/home/roadmr/Documents/checkboxes/checkbox-experiment/checkbox/reactor.py", line 74, in fire
    results.append(handler(*args, **kwargs))
  File "./plugins/jobs_prompt.py", line 86, in prompt_job
    if job[attribute] in self._ignore:
KeyError: 'description'

How to reproduce:
 - Add info/hdparm to a whitelist (for instance, the default whitelist) - best to add it at the very end.
 - Launch checkbox-gtk.
 - Deselect all tests.
- Complete the checkbox run.

Expected result:
- No hdparm-related errors in the log file

Actual result:
Error trace as shown above.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Turned out to be pretty easy to fix, as the info/hdparm job was simply missing the description field. :)

Changed in checkbox:
assignee: nobody → Daniel Manrique (roadmr)
importance: Undecided → Low
importance: Low → Medium
status: New → In Progress
Ara Pulido (ara)
Changed in checkbox:
milestone: none → 0.12.5
Daniel Manrique (roadmr)
Changed in checkbox:
status: In Progress → Fix Committed
Ara Pulido (ara)
Changed in checkbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers