Bug 1382911 - Fix linting issues
MozReview-Commit-ID: IzjHPADzqIM
--- a/taskcluster/actions/add-new-jobs.py
+++ b/taskcluster/actions/add-new-jobs.py
@@ -9,16 +9,17 @@ from taskgraph.util.time import (
current_json_time,
json_time_from_now
)
TASKCLUSTER_INDEX_URL = 'https://index.taskcluster.net/v1/task'
logger = logging.getLogger(__name__)
+
@register_callback_action(
name='Retrigger tasks',
title='Schedule Tasks Retrigger',
symbol='rj-custom',
description="Retriggers the specified job(s)",
order=10000,
context=[{}],
schema={
@@ -29,18 +30,22 @@ logger = logging.getLogger(__name__)
'default': [
'build-win64/opt'
]
}
}
}
)
def add_new_jobs_action(parameters, input, task_group_id, task_id, task):
- session = requests.Session()
- task_graph = session.get(url='{}/gecko.v2.{}.pushlog-id.{}.decision/artifacts/{}'.format(TASKCLUSTER_INDEX_URL, parameters['project'], parameters['pushlog_id'], 'public/full-task-graph.json')).json()
+ s = requests.Session()
+ task_graph = s.get(url='{}/gecko.v2.{}.pushlog-id.{}.decision/artifacts/{}'.format(
+ TASKCLUSTER_INDEX_URL,
+ parameters['project'],
+ parameters['pushlog_id'],
+ 'public/full-task-graph.json')).json()
for elem in input['tasks']:
if elem in task_graph:
new_task_definition = copy.copy(task_graph[elem]['task'])
# set new created, deadline, and expiry fields
new_task_definition['created'] = current_json_time()
new_task_definition['deadline'] = json_time_from_now('1d')
@@ -48,9 +53,9 @@ def add_new_jobs_action(parameters, inpu
new_task_definition['schedulerId'] = 'gecko-level-{}'.format(parameters['level'])
logging.info("New full task definition: %s", new_task_definition)
# actually create the new task
new_task_id = slugid()
logger.info("Retriggering task with id %s", new_task_id)
- create_task(session, new_task_id, 'task-retrigger', new_task_definition)
+ create_task(s, new_task_id, 'task-retrigger', new_task_definition)