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:
parent
6edaa353b1
commit
92b6078314
|
@ -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))
|
||||
|
||||
|
|
Loading…
Reference in New Issue