Merge pull request #767 from sfromm/issue765

Catch exception if form factor id is unknown
This commit is contained in:
Michael DeHaan 2012-08-02 07:08:36 -07:00
commit a015c2e581

View file

@ -250,7 +250,11 @@ class LinuxHardware(Hardware):
data = get_file_content(path)
if data is not None:
if key == 'form_factor':
self.facts['form_factor'] = LinuxHardware.FORM_FACTOR[int(data)]
try:
self.facts['form_factor'] = LinuxHardware.FORM_FACTOR[int(data)]
except IndexError, e:
self.facts['form_factor'] = 'unknown (%s)' % data
else:
self.facts[key] = data
else: