Catch exception if form factor id is unknown

pull/767/head
Stephen Fromm 12 years ago
parent 38ed7ca7df
commit 9a3ad060dc

@ -250,7 +250,11 @@ class LinuxHardware(Hardware):
data = get_file_content(path)
if data is not None:
if key == 'form_factor':
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:

Loading…
Cancel
Save