No bug: Provide a aiohttp session to `fxci generate-worker-pools`; r=aki
authorTom Prince <mozilla@hocat.ca>
Fri, 22 May 2020 17:07:54 +0000
changeset 230 4c0f1c72f97c110904382944f2a6c9593a1422b0
parent 229 1fe502e14c9ec3726c0c263e50a5eb1392be8008
child 231 d58dab2cc7d7c0d35a5ec524e188fc09dbf05ec1
push id165
push usermozilla@hocat.ca
push dateMon, 25 May 2020 18:07:14 +0000
treeherderci-admin@4c0f1c72f97c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaki
No bug: Provide a aiohttp session to `fxci generate-worker-pools`; r=aki I missed this when originally implementing it because I only tested against local configurations. Differential Revision: https://phabricator.services.mozilla.com/D76443
src/fxci/workers.py
--- a/src/fxci/workers.py
+++ b/src/fxci/workers.py
@@ -7,28 +7,30 @@
 import re
 
 import attr
 from taskcluster import WorkerManager, optionsFromEnvironment
 
 from ciadmin.generate.ciconfig.environment import Environment
 from ciadmin.generate.ciconfig.worker_pools import WorkerPool
 from ciadmin.generate.worker_pools import generate_pool_variants
+from tcadmin.util.sessions import with_aiohttp_session
 
 
 def list_workers(worker_pool, states, *, formatter):
     workers = []
     wm = WorkerManager(optionsFromEnvironment())
     wm.listWorkersForWorkerPool(
         worker_pool, paginationHandler=lambda r: workers.extend(r["workers"])
     )
 
     formatter([worker for worker in workers if worker["state"] in states])
 
 
+@with_aiohttp_session
 async def generate_worker_pools(*, formatter, grep):
     worker_pools = await WorkerPool.fetch_all()
     environment = await Environment.current()
 
     if grep:
         grep = re.compile(grep)
 
     def match(pool):