Catch exception if form factor id is unknown
This commit is contained in:
parent
508fcf9b03
commit
1f2de09530
1 changed files with 5 additions and 1 deletions
6
setup
6
setup
|
@ -250,7 +250,11 @@ class LinuxHardware(Hardware):
|
||||||
data = get_file_content(path)
|
data = get_file_content(path)
|
||||||
if data is not None:
|
if data is not None:
|
||||||
if key == 'form_factor':
|
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:
|
else:
|
||||||
self.facts[key] = data
|
self.facts[key] = data
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue