Merge "GetBootImageBuildProp returns None if file does not exist" am: 7a27574e5f am: 465b5033d6

Original change: https://android-review.googlesource.com/c/platform/build/+/1548355

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I5ebf9fcba3f2fa3ab6318791729cc399529bf337
This commit is contained in:
Yifan Hong 2021-01-13 20:58:07 +00:00 committed by Automerger Merge Worker
commit 0a1ec72b05

View file

@ -3672,14 +3672,13 @@ def GetBootImageBuildProp(boot_img):
RunAndCheckOutput(['toybox', 'cpio', '-F', abs_uncompressed_ramdisk, '-i'], RunAndCheckOutput(['toybox', 'cpio', '-F', abs_uncompressed_ramdisk, '-i'],
cwd=extracted_ramdisk) cwd=extracted_ramdisk)
prop_file = None
for search_path in RAMDISK_BUILD_PROP_REL_PATHS: for search_path in RAMDISK_BUILD_PROP_REL_PATHS:
prop_file = os.path.join(extracted_ramdisk, search_path) prop_file = os.path.join(extracted_ramdisk, search_path)
if os.path.isfile(prop_file): if os.path.isfile(prop_file):
break return prop_file
logger.warning('Unable to get boot image timestamp: no %s in ramdisk', search_path) logger.warning('Unable to get boot image timestamp: no %s in ramdisk', search_path)
return prop_file return None
except ExternalError as e: except ExternalError as e:
logger.warning('Unable to get boot image build props: %s', e) logger.warning('Unable to get boot image build props: %s', e)