From a16582b8c739db417c443c7c91923fae0f05bd9b Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 6 Jan 2025 21:14:18 +0100 Subject: [PATCH] tools/osbuild-image-info: Mount() with partition=None Always set partition=None for the kwargs of the Mount() constructor. The previous code was added for backwards compatibility with older versions of the Mount() constructor that didn't include the 'partition argument. It's safe to remove now because: 1. It's been long enough that we wont run osbuild-image-info with an old version of osbuild. 2. The tool is packaged with osbuild so there is no version drift and no compatibility issues. --- tools/osbuild-image-info | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/osbuild-image-info b/tools/osbuild-image-info index a4cef88b..df170015 100755 --- a/tools/osbuild-image-info +++ b/tools/osbuild-image-info @@ -2707,12 +2707,8 @@ def append_partitions(report, image): "device": devices_map[part_device], "target": part_mountpoint, "options": options, + "partition": None, } - # XXX: remove inspect and just add once osbuild PR#1501 is merged - import inspect - if "partition" in inspect.getfullargspec(mounts.Mount).args: - # Just a filesystem, no partitions on this device - mnt_kwargs["partition"] = None mmgr.mount(mounts.Mount(**mnt_kwargs)) if not root_tree: raise RuntimeError("The root filesystem tree is not mounted")