Fix lint errors on ota_utils.py
Pylint reports lot of error on ota_utils.py, because some members of OPTIONS object aren't defined. This CL moves some definition from ota_from_target_files.py to ota_utils.py to fix these lint errors. Test: Make an OTA package Change-Id: I1e9f255d5919712b13329046c72650dfac184701
This commit is contained in:
@@ -216,6 +216,7 @@ import sys
|
|||||||
import zipfile
|
import zipfile
|
||||||
|
|
||||||
import common
|
import common
|
||||||
|
import ota_utils
|
||||||
import target_files_diff
|
import target_files_diff
|
||||||
from check_target_files_vintf import CheckVintfIfTrebleEnabled
|
from check_target_files_vintf import CheckVintfIfTrebleEnabled
|
||||||
from non_ab_ota import GenerateNonAbOtaPackage
|
from non_ab_ota import GenerateNonAbOtaPackage
|
||||||
@@ -228,20 +229,16 @@ if sys.hexversion < 0x02070000:
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
OPTIONS = common.OPTIONS
|
OPTIONS = ota_utils.OPTIONS
|
||||||
OPTIONS.package_key = None
|
|
||||||
OPTIONS.incremental_source = None
|
|
||||||
OPTIONS.verify = False
|
OPTIONS.verify = False
|
||||||
OPTIONS.patch_threshold = 0.95
|
OPTIONS.patch_threshold = 0.95
|
||||||
OPTIONS.wipe_user_data = False
|
OPTIONS.wipe_user_data = False
|
||||||
OPTIONS.downgrade = False
|
|
||||||
OPTIONS.extra_script = None
|
OPTIONS.extra_script = None
|
||||||
OPTIONS.worker_threads = multiprocessing.cpu_count() // 2
|
OPTIONS.worker_threads = multiprocessing.cpu_count() // 2
|
||||||
if OPTIONS.worker_threads == 0:
|
if OPTIONS.worker_threads == 0:
|
||||||
OPTIONS.worker_threads = 1
|
OPTIONS.worker_threads = 1
|
||||||
OPTIONS.two_step = False
|
OPTIONS.two_step = False
|
||||||
OPTIONS.include_secondary = False
|
OPTIONS.include_secondary = False
|
||||||
OPTIONS.no_signing = False
|
|
||||||
OPTIONS.block_based = True
|
OPTIONS.block_based = True
|
||||||
OPTIONS.updater_binary = None
|
OPTIONS.updater_binary = None
|
||||||
OPTIONS.oem_dicts = None
|
OPTIONS.oem_dicts = None
|
||||||
@@ -257,14 +254,9 @@ OPTIONS.payload_signer = None
|
|||||||
OPTIONS.payload_signer_args = []
|
OPTIONS.payload_signer_args = []
|
||||||
OPTIONS.payload_signer_maximum_signature_size = None
|
OPTIONS.payload_signer_maximum_signature_size = None
|
||||||
OPTIONS.extracted_input = None
|
OPTIONS.extracted_input = None
|
||||||
OPTIONS.key_passwords = []
|
|
||||||
OPTIONS.skip_postinstall = False
|
OPTIONS.skip_postinstall = False
|
||||||
OPTIONS.retrofit_dynamic_partitions = False
|
|
||||||
OPTIONS.skip_compatibility_check = False
|
OPTIONS.skip_compatibility_check = False
|
||||||
OPTIONS.output_metadata_path = None
|
|
||||||
OPTIONS.disable_fec_computation = False
|
OPTIONS.disable_fec_computation = False
|
||||||
OPTIONS.force_non_ab = False
|
|
||||||
OPTIONS.boot_variable_file = None
|
|
||||||
|
|
||||||
|
|
||||||
POSTINSTALL_CONFIG = 'META/postinstall_config.txt'
|
POSTINSTALL_CONFIG = 'META/postinstall_config.txt'
|
||||||
|
@@ -21,6 +21,18 @@ from common import (ZipDelete, ZipClose, OPTIONS, MakeTempFile,
|
|||||||
ZipWriteStr, BuildInfo, LoadDictionaryFromFile,
|
ZipWriteStr, BuildInfo, LoadDictionaryFromFile,
|
||||||
SignFile, PARTITIONS_WITH_CARE_MAP, PartitionBuildProps)
|
SignFile, PARTITIONS_WITH_CARE_MAP, PartitionBuildProps)
|
||||||
|
|
||||||
|
|
||||||
|
OPTIONS.no_signing = False
|
||||||
|
OPTIONS.force_non_ab = False
|
||||||
|
OPTIONS.wipe_user_data = False
|
||||||
|
OPTIONS.downgrade = False
|
||||||
|
OPTIONS.key_passwords = {}
|
||||||
|
OPTIONS.package_key = None
|
||||||
|
OPTIONS.incremental_source = None
|
||||||
|
OPTIONS.retrofit_dynamic_partitions = False
|
||||||
|
OPTIONS.output_metadata_path = None
|
||||||
|
OPTIONS.boot_variable_file = None
|
||||||
|
|
||||||
METADATA_NAME = 'META-INF/com/android/metadata'
|
METADATA_NAME = 'META-INF/com/android/metadata'
|
||||||
UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'OTA/*', 'RADIO/*']
|
UNZIP_PATTERN = ['IMAGES/*', 'META/*', 'OTA/*', 'RADIO/*']
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user