tools_postinstall: list all partitions (not only physical ones)

This allows special installation cases such as in a container, where disk_partitions(all=False) would not show virtual mount points.
This commit is contained in:
Salamandar 2022-08-27 11:23:28 +02:00 committed by GitHub
parent 86e13b06a4
commit 8951eb38bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -219,7 +219,7 @@ def tools_postinstall(
)
# Check there's at least 10 GB on the rootfs...
disk_partitions = sorted(psutil.disk_partitions(), key=lambda k: k.mountpoint)
disk_partitions = sorted(psutil.disk_partitions(all=True), key=lambda k: k.mountpoint)
main_disk_partitions = [d for d in disk_partitions if d.mountpoint in ["/", "/var"]]
main_space = sum(
psutil.disk_usage(d.mountpoint).total for d in main_disk_partitions