Merge "releasetools: Make apex_utils Python 3 compatible."

am: 58abe77060

Change-Id: I08854acb42c49dc145730210f44261ed38ac9451
This commit is contained in:
Tao Bao
2019-06-25 15:57:32 -07:00
committed by android-build-merger

View File

@@ -59,9 +59,9 @@ def SignApexPayload(payload_file, payload_key_path, payload_key_name, algorithm,
try: try:
common.RunAndCheckOutput(cmd) common.RunAndCheckOutput(cmd)
except common.ExternalError as e: except common.ExternalError as e:
raise ApexSigningError, \ raise ApexSigningError(
'Failed to sign APEX payload {} with {}:\n{}'.format( 'Failed to sign APEX payload {} with {}:\n{}'.format(
payload_file, payload_key_path, e), sys.exc_info()[2] payload_file, payload_key_path, e))
# Verify the signed payload image with specified public key. # Verify the signed payload image with specified public key.
logger.info('Verifying %s', payload_file) logger.info('Verifying %s', payload_file)
@@ -75,9 +75,9 @@ def VerifyApexPayload(payload_file, payload_key):
try: try:
common.RunAndCheckOutput(cmd) common.RunAndCheckOutput(cmd)
except common.ExternalError as e: except common.ExternalError as e:
raise ApexSigningError, \ raise ApexSigningError(
'Failed to validate payload signing for {} with {}:\n{}'.format( 'Failed to validate payload signing for {} with {}:\n{}'.format(
payload_file, payload_key, e), sys.exc_info()[2] payload_file, payload_key, e))
def ParseApexPayloadInfo(payload_path): def ParseApexPayloadInfo(payload_path):
@@ -100,9 +100,9 @@ def ParseApexPayloadInfo(payload_path):
try: try:
output = common.RunAndCheckOutput(cmd) output = common.RunAndCheckOutput(cmd)
except common.ExternalError as e: except common.ExternalError as e:
raise ApexInfoError, \ raise ApexInfoError(
'Failed to get APEX payload info for {}:\n{}'.format( 'Failed to get APEX payload info for {}:\n{}'.format(
payload_path, e), sys.exc_info()[2] payload_path, e))
# Extract the Algorithm / Salt / Prop info from payload (i.e. an image signed # Extract the Algorithm / Salt / Prop info from payload (i.e. an image signed
# with avbtool). For example, # with avbtool). For example,