aboutsummaryrefslogtreecommitdiffstats
path: root/mpm/python/usrp_mpm/periph_manager/base.py
diff options
context:
space:
mode:
authorLane Kolbly <lane.kolbly@ni.com>2020-06-03 15:27:57 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-06-05 15:03:08 -0500
commit6aa090b7fdab3f380b52b1e572f2602e049d7d2b (patch)
treeb117cf27257c3c0e84d03d44dcade0a695d50cff /mpm/python/usrp_mpm/periph_manager/base.py
parent512fd1151fe72bb8d8e45e371348bf0f71309192 (diff)
downloaduhd-6aa090b7fdab3f380b52b1e572f2602e049d7d2b.tar.gz
uhd-6aa090b7fdab3f380b52b1e572f2602e049d7d2b.tar.bz2
uhd-6aa090b7fdab3f380b52b1e572f2602e049d7d2b.zip
mpm: Return filesystem info from get_device_info
This commit returns information on the filesystem and mender artifact versions to clients of the MPM RPC connection.
Diffstat (limited to 'mpm/python/usrp_mpm/periph_manager/base.py')
-rw-r--r--mpm/python/usrp_mpm/periph_manager/base.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py
index 6031d6921..c13fb58bc 100644
--- a/mpm/python/usrp_mpm/periph_manager/base.py
+++ b/mpm/python/usrp_mpm/periph_manager/base.py
@@ -166,6 +166,20 @@ class PeriphManagerBase(object):
version_string = ""
mboard_info["mpm_sw_version"] = version_string
+ try:
+ with open("/etc/version", "r") as version_file:
+ mboard_info["fs_version"] = version_file.read().strip(" \r\n")
+ except FileNotFoundError:
+ mboard_info["fs_version"] = "FILE NOT FOUND"
+
+ try:
+ with open("/etc/mender/artifact_info", "r") as artifact_file:
+ for line in artifact_file.read().splitlines():
+ if line.startswith('artifact_name='):
+ mboard_info['mender_artifact'] = line[14:]
+ except FileNotFoundError:
+ mboard_info['mender_artifact'] = "FILE NOT FOUND"
+
for i,dboard_info in enumerate(dboard_infos):
mboard_info["dboard_{}_pid".format(i)] = str(dboard_info["pid"])
mboard_info["dboard_{}_serial".format(i)] = dboard_info["eeprom_md"]["serial"]