Bug 1382911 - Fix linting issues draft
authorHassan Ali <helfi92@gmail.com>
Fri, 21 Jul 2017 09:31:13 -0400
changeset 613086 5efd6f0542f82b1cd8124b7c25a06ccac9ba57c0
parent 613085 cfc5fab71116a51a4c5de836a098ec4cfdcb7488
child 638608 7a1bea3a0e1be3d485e912123aa284b003467c51
push id69723
push userbmo:helfi92@gmail.com
push dateFri, 21 Jul 2017 14:57:00 +0000
bugs1382911
milestone56.0a1
Bug 1382911 - Fix linting issues MozReview-Commit-ID: IzjHPADzqIM
taskcluster/actions/add-new-jobs.py
--- 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)