Return empty deviceTypes in readYAML on error

instead of continuing with uninitilized data
This commit is contained in:
Mark Tinberg 2020-11-12 13:22:35 -06:00
parent 54907aaffb
commit 2188ac7a62

View File

@ -48,6 +48,7 @@ def readYAMl(files):
data = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
return deviceTypes
manufacturer = data['manufacturer']
data['manufacturer'] = {}
data['manufacturer']['name'] = manufacturer