battery throws a DivideByZero error when you enter a wrong accomplishment

Bug #1032458 reported by Matt Fischer on 2012-08-03
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Accomplishments Battery
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) on 2012-08-03
Changed in ubuntu-accomplishments-battery:
importance: Undecided → Medium
Jono Bacon (jonobacon) on 2012-08-03
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  Edit
Everyone can see this information.

Other bug subscribers