Snap for 9966400 from f1b6c0d824ead39ebcc1d9dd7fba47dc0435c4d3 to udc-release

Change-Id: I480571d4f4c6f98fbd66bcb2de88855fa77296b1
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 @@
   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 @@
 # 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 @@
   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 @@
   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 @@
   """
   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