diff options
author | David Shrewsbury <dshrewsb@redhat.com> | 2019-05-23 16:39:24 -0400 |
---|---|---|
committer | David Shrewsbury <dshrewsb@redhat.com> | 2019-09-16 08:47:53 -0400 |
commit | 716ac1f2e18394dcb47ac6e02e12313b6fdf18ec (patch) | |
tree | 23f946bafca1ee88ec65728c079eed0ac68625e5 /zuul/web | |
parent | 8c1f4e9d6b9f199850f3fb3d9c0a1cfd00c45b08 (diff) | |
download | zuul-716ac1f2e18394dcb47ac6e02e12313b6fdf18ec.tar.gz |
Store autohold requests in zookeeper
Storing autohold requests in ZooKeeper, rather than in-memory,
allows us to remember requests across restarts, and is a necessity
for future work to scale out the scheduler.
Future changes to build on this will allow us to store held node
information with the change for easy node identification, and to
delete any held nodes for a request using the zuul CLI.
A new 'zuul autohold-delete' command is added since hold requests
are no longer automatically deleted.
This makes the autohold API:
zuul autohold: Create a new hold request
zuul autohold-list: List current hold requests
zuul autohold-delete: Delete a hold request
Change-Id: I6130175d1dc7d6c8ce8667f9b14ae9377737d280
Diffstat (limited to 'zuul/web')
-rwxr-xr-x | zuul/web/__init__.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/zuul/web/__init__.py b/zuul/web/__init__.py index 4f6ce1384..331df1e7a 100755 --- a/zuul/web/__init__.py +++ b/zuul/web/__init__.py @@ -417,19 +417,19 @@ class ZuulWebAPI(object): else: payload = json.loads(job.data[0]) result = [] - for key in payload: - _tenant, _project, job, ref_filter = key.split(',') - count, reason, hold_expiration = payload[key] - if tenant == _tenant: - if project is None or _project.endswith(project): + for request in payload: + if tenant == request['tenant']: + if (project is None or + request['project'].endswith(project)): result.append( - {'tenant': _tenant, - 'project': _project, - 'job': job, - 'ref_filter': ref_filter, - 'count': count, - 'reason': reason, - 'node_hold_expiration': hold_expiration}) + {'tenant': request['tenant'], + 'project': request['project'], + 'job': request['job'], + 'ref_filter': request['ref_filter'], + 'count': request['max_count'], + 'reason': request['reason'], + 'node_hold_expiration': request['node_expiration'] + }) return result @cherrypy.expose |