From 24eaff69519674715ea2aab4eba0e73675a04e57 Mon Sep 17 00:00:00 2001 From: Arksine Date: Mon, 26 Apr 2021 09:09:17 -0400 Subject: [PATCH] machine: add distribution to system info Signed-off-by: Eric Callahan --- moonraker/components/machine.py | 6 +++++- scripts/moonraker-requirements.txt | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/moonraker/components/machine.py b/moonraker/components/machine.py index 3c77c4d..1d2a963 100644 --- a/moonraker/components/machine.py +++ b/moonraker/components/machine.py @@ -8,6 +8,7 @@ import re import pathlib import logging import platform +import distro from tornado.ioloop import IOLoop ALLOWED_SERVICES = ["moonraker", "klipper", "webcamd"] @@ -21,9 +22,12 @@ SD_MFGRS = { class Machine: def __init__(self, config): self.server = config.get_server() + dist_info = {'name': distro.name(pretty=True)} + dist_info.update(distro.info()) self.system_info = { 'cpu_info': self._get_cpu_info(), - 'sd_info': self._get_sdcard_info() + 'sd_info': self._get_sdcard_info(), + 'distribution': dist_info } # Add system info to log rollover sys_info_msg = "\nSystem Info:" diff --git a/scripts/moonraker-requirements.txt b/scripts/moonraker-requirements.txt index a379303..8d42bed 100644 --- a/scripts/moonraker-requirements.txt +++ b/scripts/moonraker-requirements.txt @@ -4,3 +4,4 @@ pyserial==3.4 pillow==8.1.2 lmdb==1.2.1 streaming-form-data==1.8.1 +distro==1.5.0