Skip to content
Snippets Groups Projects

PyJobTransforms: Protection for missing distro package

Merged Johannes Elmsheuser requested to merge elmsheus/athena:distro_20211013 into master
1 file
+ 5
2
Compare changes
  • Side-by-side
  • Inline
@@ -14,9 +14,12 @@ import pickle as pickle
import json
import os.path
import platform
import distro
import pprint
import sys
try:
import distro
except ImportError:
pass
from xml.etree import ElementTree
@@ -590,7 +593,7 @@ class machineReport(object):
for attr in attrs:
try:
machine[attr] = getattr(distro, attr).__call__()
except AttributeError as e:
except (AttributeError,NameError) as e:
msg.warning('Failed to get "{0}" attribute from platform module: {1}'.format(attr, e))
# Now try to get processor information from /proc/cpuinfo
Loading