/usr/lib/checkbox/bin/audio_settings:ValueError:<module>:main:restore_audio_settings

Bug #1065703 reported by Evan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
checkbox (Ubuntu)
Fix Released
High
Daniel Manrique
Tags: patch

Related branches

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

OK, we have 11 instances of this problem, the error trace is as follows (from the above automated error report):

Traceback (most recent call last):
  File "/usr/share/checkbox/scripts/audio_settings", line 182, in <module>
    sys.exit(main())
  File "/usr/share/checkbox/scripts/audio_settings", line 174, in main
    restore_audio_settings(args.file)
  File "/usr/share/checkbox/scripts/audio_settings", line 108, in restore_audio_settings
    index = settings_file[settings_file.index("%s_index:" % type) + 1]
ValueError: 'source_index:' is not in list

Steps to reproduce:

- Run audio_settings restore with a file that does NOT contain correct saved audio settings data:

/usr/share/checkbox/scripts/audio_settings restore --file=/etc/hosts

- Expected result:
 If the file does NOT contain valid key/value pairs, the script should fail gracefully, while outputting a helpful message to stdout.

- Actual result:
  Horrible trace as seen above.

For reference, a valid file looks like this:

source_index: 1
source_muted: no
source_volume: 40632
sink_index: 2
sink_muted: no
sink_volume: 33423

I'm unsure how users are managing to point the script at an invalid file, but the script should still handle this situation more user-friendlily.

Changed in checkbox (Ubuntu):
importance: Undecided → High
status: New → Triaged
Revision history for this message
Daniel Manrique (roadmr) wrote :

The version of the script shipped with Quantal produces this form of data file:

source_index: 1
source_muted: no
source_volume: 40632
sink_index: 2
sink_muted: no
sink_volume: 33423

While the version in trunk uses this instead:

default_source: alsa_input.pci-0000_00_1b.0.analog-stereo
source_muted: no
source_volume: 56%
default_sink: alsa_output.pci-0000_00_1b.0.analog-stereo
sink_muted: no
sink_volume: 30%

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

This patch is for the 0.14 version of audio_settings, based on the fix proposed in trunk.

Changed in checkbox (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Daniel Manrique (roadmr)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "audio_settings_1065703.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in checkbox (Ubuntu):
status: In Progress → Fix Committed
Changed in checkbox (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.