diff --git a/tools/code_coverage_tools/taskcluster.py b/tools/code_coverage_tools/taskcluster.py index 6bf7a74ce..03f91d190 100644 --- a/tools/code_coverage_tools/taskcluster.py +++ b/tools/code_coverage_tools/taskcluster.py @@ -5,7 +5,6 @@ import copy import os -import re import structlog import taskcluster @@ -20,26 +19,6 @@ TASKCLUSTER_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ" -def read_hosts(): - """ - Read /etc/hosts to get hostnames - on a Nix env (used for taskclusterProxy) - Only reads ipv4 entries to avoid duplicates - """ - out = {} - regex = re.compile(r"([\w:\-\.]+)") - for line in open("/etc/hosts").readlines(): - if ":" in line: # only ipv4 - continue - x = regex.findall(line) - if not x: - continue - ip, names = x[0], x[1:] - out.update(dict(zip(names, [ip] * len(names)))) - - return out - - class TaskclusterConfig(object): """ Local configuration used to access Taskcluster service and objects @@ -90,16 +69,8 @@ def auth(self, client_id=None, access_token=None): self.options["rootUrl"] = "https://taskcluster.net" else: - # Get taskcluster proxy host - # as /etc/hosts is not used in the Nix image (?) - hosts = read_hosts() - if "taskcluster" not in hosts: - raise Exception("Missing taskcluster in /etc/hosts") - - # Load secrets from TC task context # with taskclusterProxy - root_url = f"http://{hosts['taskcluster']}" - + root_url = "http://taskcluster" logger.info("Taskcluster Proxy enabled", url=root_url) self.options["rootUrl"] = root_url