From d34ef0ab25ab735f6c96fcf88da480c91a9c6a2c Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Mon, 13 Nov 2023 21:01:52 +0100 Subject: utils: sw_inventory: report unknown OS for software inventory Users can create an image of a filesystem that contains no OS, therefore, instead of rising an exception when no OS is detected, deliver a "unknown" OS and an empty list of software. --- src/utils/sw_inventory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/sw_inventory.py b/src/utils/sw_inventory.py index 69c1f2c..b2d55c3 100644 --- a/src/utils/sw_inventory.py +++ b/src/utils/sw_inventory.py @@ -126,6 +126,7 @@ def get_package_set(mountpoint): pkgset = _get_package_set_dpkg(dpkg_status_path) osname = getlinuxversion(osrelease) else: - raise ValueError(f'Cannot fetch software inventory at {mountpoint}') + pkgset = set() + osname = "unknown" # Legacy software inventory first element is the OS name return [osname] + list(pkgset) -- cgit v1.2.3-18-g5258