handle distro import error

This commit is contained in:
Jack Robison 2018-08-17 10:28:47 -04:00
parent 4a8776be10
commit c21956b4f3
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -36,9 +36,12 @@ def get_platform(get_ip=True):
"build": build_type.BUILD, # CI server sets this during build step "build": build_type.BUILD, # CI server sets this during build step
} }
if p["os_system"] == "Linux": if p["os_system"] == "Linux":
import distro try:
p["distro"] = distro.info() import distro
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown') p["distro"] = distro.info()
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown')
except ModuleNotFoundError:
pass
# TODO: remove this from get_platform and add a get_external_ip function using treq # TODO: remove this from get_platform and add a get_external_ip function using treq
if get_ip: if get_ip: