tools/image-info: consistent use of - over _

And remove a stray comment and whitespace.
This commit is contained in:
Lars Karlitski 2019-09-30 15:23:32 +02:00 committed by Tom Gundersen
parent e43955a4c5
commit 9867846ff4

View file

@ -91,17 +91,14 @@ report = {}
with nbd_connect(image) as device:
report["image-format"] = read_image_format(image)
report["bootloader"] = read_bootloader_type(device)
report["partition_table"], report["partitions"] = read_partition_table(device)
report["partition-table"], report["partitions"] = read_partition_table(device)
n_partitions = len(report["partitions"])
for n in range(1, n_partitions + 1):
with mount(device + f"p{n}") as tree:
# subprocess.run(["ls", "-l", tree])
if os.path.exists(f"{tree}/etc/os-release"):
report["packages"] = sorted(subprocess_check_output(["rpm", "--root", tree, "-qa"], str.split))
report["os_release"] = read_os_release(tree)
report["os-release"] = read_os_release(tree)
with open(f"{tree}/etc/fstab") as f:
report["fstab"] = sorted([line.split() for line in f.read().split("\n") if line and not line.startswith("#")])