Simplify codes for BuildSuperImage func

Use common function LoadDictionaryFromFile(), instead
of LoadDictionaryFromLines(). Makes these codes conciser.

Change-Id: Ibb6f19744246b3415bcd639bc59dbb2aede725d9
Signed-off-by: jiajia tang <tangjiajia@xiaomi.com>
This commit is contained in:
jiajia tang 2021-04-23 19:48:11 +08:00
parent 6edaa353b1
commit 92b6078314
1 changed files with 1 additions and 3 deletions

View File

@ -194,10 +194,8 @@ def BuildSuperImage(inp, out):
return BuildSuperImageFromTargetFiles(inp, out)
if os.path.isfile(inp):
with open(inp) as f:
lines = f.read()
logger.info("Building super image from info dict...")
return BuildSuperImageFromDict(common.LoadDictionaryFromLines(lines.split("\n")), out)
return BuildSuperImageFromDict(common.LoadDictionaryFromFile(inp), out)
raise ValueError("{} is not a dictionary or a valid path".format(inp))