diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-19 01:37:50 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-04-19 01:37:50 +0000 |
commit | d791d252cde56ed3988793bc9d217150092153f3 (patch) | |
tree | 3db9be87e973a94975d18d459a2428a086cad898 | |
parent | 9f24251717d2cf59ad16e557aff5ed67578b63b2 (diff) | |
parent | 98b89c632bd431d267cc8c82109fc4bfb1ee8e3d (diff) | |
download | treble-d791d252cde56ed3988793bc9d217150092153f3.tar.gz |
Snap for 9966320 from 98b89c632bd431d267cc8c82109fc4bfb1ee8e3d to udc-d1-releaseandroid-14.0.0_r9android-14.0.0_r8android-14.0.0_r7android-14.0.0_r6android-14.0.0_r5android-14.0.0_r4android-14.0.0_r3android-14.0.0_r12android-14.0.0_r11android-14.0.0_r10android14-d1-s7-releaseandroid14-d1-s6-releaseandroid14-d1-s5-releaseandroid14-d1-s4-releaseandroid14-d1-s3-releaseandroid14-d1-s2-releaseandroid14-d1-s1-releaseandroid14-d1-release
Change-Id: I27b09e7ff8ab519e7a3c298b7836a6f9049e844b
-rw-r--r-- | fetcher/Android.bp | 1 | ||||
-rw-r--r-- | fetcher/fetcher_lib.py | 12 |
2 files changed, 5 insertions, 8 deletions
diff --git a/fetcher/Android.bp b/fetcher/Android.bp index fd3ff06..654a750 100644 --- a/fetcher/Android.bp +++ b/fetcher/Android.bp @@ -11,7 +11,6 @@ python_library_host { libs: [ "py-google-api-python-client", "py-oauth2client", - "py-six", ], } diff --git a/fetcher/fetcher_lib.py b/fetcher/fetcher_lib.py index 9701494..3e6288f 100644 --- a/fetcher/fetcher_lib.py +++ b/fetcher/fetcher_lib.py @@ -15,7 +15,7 @@ if sys.version_info.major == 3: # pylint: disable=import-error,g-bad-import-order,g-import-not-at-top import apiclient from googleapiclient.discovery import build -from six.moves import http_client +from googleapiclient.errors import HttpError import httplib2 from oauth2client.service_account import ServiceAccountCredentials @@ -80,7 +80,7 @@ def _simple_execute(http_request, for _ in range(max_tries): try: return http_request.execute() - except http_client.errors.HttpError as e: + except HttpError as e: last_error = e if e.resp.status in masked_errors: return None @@ -103,7 +103,7 @@ def create_client(http): Returns: An authorized android build api client. """ - return build(serviceName='androidbuildinternal', version='v2beta1', http=http, + return build(serviceName='androidbuildinternal', version='v3', http=http, static_discovery=False) @@ -201,14 +201,12 @@ def list_artifacts(client, regex, **kwargs): """ matching_artifacts = [] kwargs.setdefault('attemptId', 'latest') - regex = re.compile(regex) - req = client.buildartifact().list(**kwargs) + req = client.buildartifact().list(nameRegexp=regex, **kwargs) while req: result = _simple_execute(req) if result and 'artifacts' in result: for a in result['artifacts']: - if regex.match(a['name']): - matching_artifacts.append(a['name']) + matching_artifacts.append(a['name']) req = client.buildartifact().list_next(req, result) return matching_artifacts |