No bug: Don't use proxy for accessing taskcluster index; r=Callek

The index is not protected by scopes, so don't use the proxy to access it

Differential Revision: https://phabricator.services.mozilla.com/D77537
This commit is contained in:
Tom Prince 2020-05-29 21:37:46 +00:00
Родитель 85d3e9e10f
Коммит 98dd864200
2 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -5,7 +5,6 @@
from __future__ import absolute_import, print_function, unicode_literals
import logging
import os
import mozpack.path as mozpath
from mozbuild.base import MozbuildObject
@ -35,9 +34,7 @@ class IndexSearch(OptimizationStrategy):
"Look for a task with one of the given index paths"
for index_path in index_paths:
try:
task_id = find_task_id(
index_path,
use_proxy=bool(os.environ.get('TASK_ID')))
task_id = find_task_id(index_path)
return task_id
except KeyError:
# 404 will end up here and go on to the next index path

Просмотреть файл

@ -176,9 +176,9 @@ def get_index_url(index_path, use_proxy=False, multiple=False):
return index_tmpl.format('s' if multiple else '', index_path)
def find_task_id(index_path, use_proxy=False):
def find_task_id(index_path):
try:
response = _do_request(get_index_url(index_path, use_proxy))
response = _do_request(get_index_url(index_path))
except requests.exceptions.HTTPError as e:
if e.response.status_code == 404:
raise KeyError("index path {} not found".format(index_path))