mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Catch exception if form factor id is unknown
This commit is contained in:
parent
38ed7ca7df
commit
9a3ad060dc
1 changed files with 5 additions and 1 deletions
|
@ -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…
Reference in a new issue