Bug 1611014 - Make sure Taskcluster root_dir is a unicode string. r=rstewart

This fixes an issue when running "mach taskgraph" with the --root parameter
from the commandline. We use this regularly when working on Thunderbird task
configuration.

The initial list of kind names is read with os.listdir(), which returns
non-unicode strings when given a non-unicode string. As a result, some tasks
fail to validate because there's a non-unicode string where a unicode string
is expected.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Rob Lemley 2020-01-23 00:32:53 +00:00
Родитель c70fa24ea8
Коммит 176cad3876
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -7,7 +7,7 @@ import logging
import os import os
import copy import copy
import attr import attr
from six import text_type from six import text_type, ensure_text
from . import filter_tasks from . import filter_tasks
from .graph import Graph from .graph import Graph
@ -115,7 +115,7 @@ class TaskGraphGenerator(object):
""" """
if root_dir is None: if root_dir is None:
root_dir = 'taskcluster/ci' root_dir = 'taskcluster/ci'
self.root_dir = root_dir self.root_dir = ensure_text(root_dir)
self._parameters = parameters self._parameters = parameters
self._target_kind = target_kind self._target_kind = target_kind