diff options
author | OpenGnSys Support Team <soporte-og@soleta.eu> | 2023-11-13 21:01:52 +0100 |
---|---|---|
committer | OpenGnSys Support Team <soporte-og@soleta.eu> | 2023-11-17 13:32:06 +0100 |
commit | d34ef0ab25ab735f6c96fcf88da480c91a9c6a2c (patch) | |
tree | 6a64c3c1db869c10525f1c4a8b5e3f4fc73c2088 | |
parent | 4e10c4656324b01529f0765bf5493fe0b2cd477c (diff) |
utils: sw_inventory: report unknown OS for software inventoryv1.3.2-2
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.
-rw-r--r-- | src/utils/sw_inventory.py | 3 |
1 files changed, 2 insertions, 1 deletions
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) |