Merge "Open ab_partitions.txt with just read access"

This commit is contained in:
Treehugger Robot 2023-06-01 21:39:35 +00:00 committed by Gerrit Code Review
commit f9a6f5f06b

View file

@ -817,8 +817,8 @@ class PayloadGenerator(object):
target_dir = ExtractTargetFiles(target_file) target_dir = ExtractTargetFiles(target_file)
cmd = ["delta_generator", cmd = ["delta_generator",
"--out_file", payload_file] "--out_file", payload_file]
with open(os.path.join(target_dir, "META", "ab_partitions.txt")) as fp: with open(os.path.join(target_dir, "META", "ab_partitions.txt"), "r") as fp:
ab_partitions = fp.read().strip().split("\n") ab_partitions = fp.read().strip().splitlines()
cmd.extend(["--partition_names", ":".join(ab_partitions)]) cmd.extend(["--partition_names", ":".join(ab_partitions)])
cmd.extend( cmd.extend(
["--new_partitions", GetPartitionImages(target_dir, ab_partitions, False)]) ["--new_partitions", GetPartitionImages(target_dir, ab_partitions, False)])