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.
This commit is contained in:
Achilleas Koutsou 2025-01-06 21:14:18 +01:00 committed by Tomáš Hozza
parent 10029167db
commit a16582b8c7

View file

@ -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")