diff options
author | Joerg Hofrichter <joerg.hofrichter@ni.com> | 2020-09-03 16:54:19 +0200 |
---|---|---|
committer | Aaron Rossetto <aaron.rossetto@ni.com> | 2020-10-06 15:21:27 -0500 |
commit | a37413055e4f72b03e3f988cea7ec2ac86590051 (patch) | |
tree | 468be86a8de84c98055a52e7a17097c84d26088c | |
parent | 86cadf12c5c4d4599fa311c83b112c5a21404564 (diff) | |
download | uhd-a37413055e4f72b03e3f988cea7ec2ac86590051.tar.gz uhd-a37413055e4f72b03e3f988cea7ec2ac86590051.tar.bz2 uhd-a37413055e4f72b03e3f988cea7ec2ac86590051.zip |
mpm: use filesystem_status from sys_utils
Use the utility functions for getting the filesystem version string
and for getting the Mender artifact which are now available in
usrp_mpm.sys_utils.
-rw-r--r-- | mpm/python/usrp_mpm/periph_manager/base.py | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/mpm/python/usrp_mpm/periph_manager/base.py b/mpm/python/usrp_mpm/periph_manager/base.py index 09f66a2d4..3feb3452a 100644 --- a/mpm/python/usrp_mpm/periph_manager/base.py +++ b/mpm/python/usrp_mpm/periph_manager/base.py @@ -17,6 +17,8 @@ from builtins import str from builtins import object from six import iteritems, itervalues from usrp_mpm.mpmlog import get_logger +from usrp_mpm.sys_utils.filesystem_status import get_fs_version +from usrp_mpm.sys_utils.filesystem_status import get_mender_artifact from usrp_mpm.sys_utils.udev import get_eeprom_paths from usrp_mpm.sys_utils.udev import get_spidev_nodes from usrp_mpm.sys_utils import dtoverlay @@ -166,19 +168,8 @@ 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" + mboard_info["fs_version"] = get_fs_version() + mboard_info['mender_artifact'] = get_mender_artifact() for i,dboard_info in enumerate(dboard_infos): mboard_info["dboard_{}_pid".format(i)] = str(dboard_info["pid"]) |