[rawfs] Read blkid stdout only once, be more clear when there isn't a uuid

This commit is contained in:
Adriaan de Groot 2024-06-20 19:38:48 +02:00
parent 2e825167a3
commit 3d4b408c93

View File

@ -146,9 +146,10 @@ def update_global_storage(item, gs):
ret = subprocess.run(["blkid", "-s", "UUID", "-o", "value", item.destination], ret = subprocess.run(["blkid", "-s", "UUID", "-o", "value", item.destination],
stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True)
if ret.returncode == 0: if ret.returncode == 0:
uuid = ret.stdout.rstrip()
libcalamares.utils.debug("Setting {} UUID to {}".format(item.destination, libcalamares.utils.debug("Setting {} UUID to {}".format(item.destination,
ret.stdout.rstrip())) uuid or "<empty>"))
gs[gs.index(partition)]["uuid"] = ret.stdout.rstrip() gs[gs.index(partition)]["uuid"] = uuid
gs[gs.index(partition)]["source"] = item.source gs[gs.index(partition)]["source"] = item.source
libcalamares.globalstorage.remove("partitions") libcalamares.globalstorage.remove("partitions")