Skip to content

Commit

Permalink
enumerate is not reversible
Browse files Browse the repository at this point in the history
  • Loading branch information
parmigggiana committed Nov 15, 2024
1 parent c8f7a7a commit cdd746e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion basilico.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ def _get_last_linux_partition_path_and_number(dev: str) -> tuple[str, str] | tup
# PARTTYPENAME could be useful, too
output = subprocess.getoutput(f"lsblk -o PATH,PARTN,PARTTYPE -J {dev}")
jsonized = json.loads(output)
for i, entry in reversed(enumerate(jsonized["blockdevices"])):
for i, entry in enumerate(jsonized["blockdevices"]):
if entry["path"]: # lsblk also returns the device itself, which has no partitions
# GPT or MBR Linux partition ID
if entry["parttype"] == "0fc63daf-8483-4772-8e79-3d69d8477de4" or entry["parttype"] == "0x83":
Expand Down

0 comments on commit cdd746e

Please sign in to comment.