battery throws a DivideByZero error when you enter a wrong accomplishment

Bug #1032458 reported by Matt Fischer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Battery
Fix Committed
Medium
Jono Bacon

Bug Description

When you misenter an accomplishment, the battery fails as follows:

mfisch@caprica:~/experiments/accomps/ubuntu-community-accomplishments/master$ accomplishments-battery -s general/aasdasda
Getting Accomplishment Data...
['/home/mfisch/experiments/accomps/ubuntu-community-accomplishments/master', '/usr/share/accomplishments']
----- RESULTS -----
Total Scripts: 0
Total Scripts Run: 0 (0 scripts exempted)
Traceback (most recent call last):
  File "/usr/bin/accomplishments-battery", line 29, in <module>
    accomplishments_battery.main()
  File "/usr/lib/python2.7/dist-packages/accomplishments_battery/__init__.py", line 45, in main
    batt.option_test_single(options.single)
  File "/usr/lib/python2.7/dist-packages/accomplishments_battery/battery.py", line 107, in option_test_single
    self.run_scripts()
  File "/usr/lib/python2.7/dist-packages/accomplishments_battery/battery.py", line 587, in run_scripts
    totalcoverage = 100 * (float(totalscriptsrun) / float(self.FINAL_TOTALSCRIPTS))
ZeroDivisionError: float division by zero

I think an error message would be more appropriate.

Matt Fischer (mfisch)
Changed in ubuntu-accomplishments-battery:
importance: Undecided → Medium
Jono Bacon (jonobacon)
Changed in ubuntu-accomplishments-battery:
assignee: nobody → Jono Bacon (jonobacon)
status: New → Fix Committed
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.