/usr/lib/checkbox/bin/audio_settings:ValueError:<module>:main:restore_audio_settings
Bug #1065703 reported by
Evan
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
checkbox (Ubuntu) |
Fix Released
|
High
|
Daniel Manrique |
Bug Description
https:/
Related branches
lp:~roadmr/checkbox/1065703-audio-settings
- Daniel Manrique (community): Needs Resubmitting
- Zygmunt Krynicki (community): Approve
-
Diff: 50 lines (+12/-3)2 files modifieddebian/changelog (+2/-0)
scripts/audio_settings (+10/-3)
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.
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): checkbox/ scripts/ audio_settings" , line 182, in <module> exit(main( )) checkbox/ scripts/ audio_settings" , line 174, in main audio_settings( args.file) checkbox/ scripts/ audio_settings" , line 108, in restore_ audio_settings file[settings_ file.index( "%s_index: " % type) + 1]
File "/usr/share/
sys.
File "/usr/share/
restore_
File "/usr/share/
index = settings_
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.