Bug 1611023: [taskgraph] Fix python3 flake8 errors in taskgraph; r=Callek

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Prince 2020-01-23 03:35:31 +00:00
parent f67d51022f
commit ecd3506c24
9 changed files with 15 additions and 12 deletions

View File

@ -124,7 +124,6 @@ per-file-ignores =
mozglue/**: F821
python/mozbuild/**: F821
python/mozversioncontrol/**: F821
taskcluster/**: F821
testing/mozharness/**: F821
testing/talos/**: F821
toolkit/components/telemetry/**: F821

View File

@ -56,7 +56,7 @@ def add_new_jobs_action(parameters, graph_config, input, task_group_id, task_id)
raise Exception('{} was not found in the task-graph'.format(elem))
times = input.get('times', 1)
for i in xrange(times):
for i in range(times):
create_tasks(
graph_config,
to_run,

View File

@ -43,7 +43,7 @@ def add_all_talos(parameters, graph_config, input, task_group_id, task_id):
parameters, graph_config)
times = input.get('times', 1)
for i in xrange(times):
for i in range(times):
to_run = [label
for label, entry
in full_task_graph.tasks.iteritems()

View File

@ -185,7 +185,7 @@ def backfill_action(parameters, graph_config, input, task_group_id, task_id):
return task
times = input.get('times', 1)
for i in xrange(times):
for i in range(times):
create_tasks(graph_config, [label], full_task_graph, label_to_taskid,
push_params, push_decision_task_id, push, modifier=modifier)
backfill_pushes.append(push)

View File

@ -12,6 +12,8 @@ import logging
import os
import re
import six
from slugid import nice as slugid
from taskgraph.util.taskcluster import list_artifacts, get_artifact, get_task_definition
from ..util.parameterization import resolve_task_references

View File

@ -169,7 +169,7 @@ def retrigger_action(parameters, graph_config, input, task_group_id, task_id):
with_downstream = ' (with downstream) '
times = input.get('times', 1)
for i in xrange(times):
for i in range(times):
create_tasks(
graph_config,
to_run,
@ -287,7 +287,7 @@ def retrigger_multiple(parameters, graph_config, input, task_group_id, task_id):
# those labels.
_rerun_task(label_to_taskid[label], label)
for j in xrange(times):
for j in range(times):
suffix = '{}-{}'.format(i, j)
suffixes.append(suffix)
create_tasks(

View File

@ -11,8 +11,9 @@ import copy
import logging
import os
import re
from functools import reduce
from six import text_type
from six import text_type, string_types
from requests.exceptions import HTTPError
@ -252,8 +253,7 @@ def add_args_to_command(cmd_parts, extra_args=[]):
# windows has single cmd part as dict: 'task-reference', with long string
cmd_parts = cmd_parts[0]['task-reference'].split(' ')
cmd_type = 'dict'
elif len(cmd_parts) == 1 and (isinstance(cmd_parts[0], unicode) or
isinstance(cmd_parts[0], str)):
elif len(cmd_parts) == 1 and isinstance(cmd_parts[0], string_types):
# windows has single cmd part as a long string
cmd_parts = cmd_parts[0].split(' ')
cmd_type = 'unicode'

View File

@ -7,6 +7,8 @@
from __future__ import absolute_import, print_function, unicode_literals
from six import string_types
def match_utc(params, sched):
"""Return True if params['time'] matches the given schedule.
@ -28,8 +30,8 @@ def match_utc(params, sched):
if sched.get('day') is not None and sched.get('day') != params['time'].day:
return False
if isinstance(sched.get('weekday'), str) or isinstance(sched.get('weekday'), unicode):
if sched.get('weekday', str()).lower() != params['time'].strftime('%A').lower():
if isinstance(sched.get('weekday'), string_types):
if sched['weekday'].lower() != params['time'].strftime('%A').lower():
return False
elif sched.get('weekday') is not None:
# don't accept other values.

View File

@ -179,7 +179,7 @@ class TestOptimize(unittest.TestCase):
def assert_subgraph(self, graph, removed_tasks, replaced_tasks,
label_to_taskid, exp_subgraph, exp_label_to_taskid):
self.maxDiff = None
optimize.slugid = ('tid{}'.format(i) for i in xrange(1, 10)).next
optimize.slugid = ('tid{}'.format(i) for i in range(1, 10)).next
try:
got_subgraph = optimize.get_subgraph(graph, removed_tasks,
replaced_tasks, label_to_taskid)