memory_compare script crashes if a system has empty RAM slots

Bug #1023220 reported by Brendan Donegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
High
Brendan Donegan

Bug Description

If the current form of the memory_compare script runs on a system that has empty RAM slots, the following exception occurs:

 Traceback (most recent call last): File "/usr/share/checkbox/scripts/memory_compare", line 70, in <module> sys.exit(main()) File "/usr/share/checkbox/scripts/memory_compare", line 53, in main installed_memory = get_installed_memory_size() File "/usr/share/checkbox/scripts/memory_compare", line 30, in get_installed_memory_size dmi.run(result) File "/usr/lib/python3/dist-packages/checkbox/parsers/dmidecode.py", line 124, in run result.addDmiDevice(device) File "/usr/share/checkbox/scripts/memory_compare", line 24, in addDmiDevice self.total_size += size TypeError: unsupported operand type(s) for +=: 'int' and 'str'

This is because the Size field will read: No Module Installed

The solution is to catch exceptions when converting the size to an int

Related branches

Changed in checkbox:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Brendan Donegan (brendan-donegan)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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