Bug 1397847: Pass the taskcluster root to load_tasks_for_kind in mach artifact toolchain; r=dustin a=tomprince

Differential Revision: https://phabricator.services.mozilla.com/D13433

--HG--
extra : rebase_source : ab46822cbf7cb72de61285eb336cb80356943752
extra : amend_source : 9ec807b18a8cc7d1b5d33cb4a4c65988fee4ff00
This commit is contained in:
Tom Prince 2018-11-29 09:37:39 -07:00
parent b3613ec011
commit a3540aa22f
2 changed files with 4 additions and 5 deletions

View File

@ -1313,8 +1313,6 @@ class PackageFrontend(MachCommandBase):
import requests
import shutil
from taskgraph.config import load_graph_config
from taskgraph.generator import Kind
from taskgraph.util.taskcluster import (
get_artifact_url,
)
@ -1433,7 +1431,8 @@ class PackageFrontend(MachCommandBase):
strict=False,
)
toolchains = load_tasks_for_kind(params, 'toolchain')
root_dir = mozpath.join(self.topsrcdir, 'taskcluster/ci')
toolchains = load_tasks_for_kind(params, 'toolchain', root_dir=root_dir)
aliases = {}
for t in toolchains.values():

View File

@ -382,13 +382,13 @@ class TaskGraphGenerator(object):
)
def load_tasks_for_kind(parameters, kind):
def load_tasks_for_kind(parameters, kind, root_dir=None):
"""
Get all the tasks of a given kind.
This function is designed to be called from outside of taskgraph.
"""
tgg = TaskGraphGenerator(root_dir=None, parameters=parameters, target_kind=kind)
tgg = TaskGraphGenerator(root_dir=root_dir, parameters=parameters, target_kind=kind)
return {
task.task['metadata']['name']: task
for task in tgg.full_task_set