zuul/tools
Felix Edel 8b7535b7a0 Don't fail on missing change_queues key in status json
Since the pipeline state is stored in ZooKeeper, there could be cases
where the change_queues key is missing in the status json. This makes
API requests fail:

2022-02-22 17:56:18,390 ERROR cherrypy.error.139989033522128: [22/Feb/2022:17:56:18] HTTP
Traceback (most recent call last):
  File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cprequest.py", line 638, in respond
    self._do_respond(path_info)
  File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cprequest.py", line 697, in _do_respond
    response.body = self.handler()
  File "/opt/zuul/lib/python3.8/site-packages/cherrypy/lib/encoding.py", line 223, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/opt/zuul/lib/python3.8/site-packages/cherrypy/lib/jsontools.py", line 59, in json_handler
    value = cherrypy.serving.request._json_inner_handler(*args, **kwargs)
  File "/opt/zuul/lib/python3.8/site-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/opt/zuul/lib/python3.8/site-packages/zuul/web/__init__.py", line 1050, in status_change
    return result_filter.filterPayload(payload)
  File "/opt/zuul/lib/python3.8/site-packages/zuul/web/__init__.py", line 193, in filterPayload
    for change_queue in pipeline['change_queues']:
KeyError: 'change_queues'

Fix this by using a .get() call rather than directly accessing the
dictionary key by name.

A similar issue was already fixed in [1].

[1]: https://review.opendev.org/c/zuul/zuul/+/829018

Change-Id: I947f58f02c3da7dad35d1fc186c7026800f7cbdd
2022-02-23 08:25:54 +01:00
..
018D05F5.gpg Avoid using apt-add-repository 2017-07-11 16:41:52 -04:00
decrypt_secret.py decrypt_secret.py: properly init SourceContext class 2021-12-17 11:35:10 -05:00
docker-compose.yaml Allow to specify MySQL port for test environment 2022-01-19 09:28:14 +01:00
encrypt_secret.py tools: Deprecate encrypt_secret.py, document zuul-client encrypt 2020-12-09 11:30:59 +00:00
fake_bwrap.py Make most test cases work on MacOS 2020-02-20 12:59:38 +01:00
find-untrusted-exec.py Add a script to find untrusted execution tasks 2020-07-22 18:29:58 +00:00
github-debugging.py Enhance github debugging script for apps 2018-02-05 12:22:26 +01:00
install-js-repos-rpm.sh Use node v10 instead of node v8 2019-02-04 21:26:37 +00:00
install-js-tools.sh install-js-tools: add support for manjaro 2020-11-07 03:26:07 +01:00
mysqld.cnf Increase MySQL connection limit in tests 2021-11-24 13:30:28 -08:00
node_usage.py Small script to scrape Zuul job node usage 2018-10-30 09:17:57 -07:00
openssl.cnf Add TLS support for ZooKeeper 2020-03-18 14:47:37 -07:00
pip.sh Don't use --verbose with yarn 2021-10-21 13:59:26 -07:00
rebuild-docs.sh Add a script to rebuild old docs 2022-01-20 10:15:42 -08:00
test-logs.sh Block localhost shell tasks in untrusted playbooks 2020-07-21 19:18:10 +02:00
test-setup-docker.sh Use ZooKeeper TLS in tests 2021-03-08 06:49:57 -08:00
test-setup.sh Use ZooKeeper TLS in tests 2021-03-08 06:49:57 -08:00
update-storyboard.py Re-enable E305 pep8 errors 2017-05-19 09:38:36 -04:00
zk-analyze.py Add some ZK debug scripts 2022-01-26 12:59:39 -08:00
zk-ca.sh Use Absolute path in zk-ca.sh for openssl config 2020-05-28 11:48:01 +02:00
zk-dump.py Add some ZK debug scripts 2022-01-26 12:59:39 -08:00
zk-shell.py Add a zk-shell debug script 2022-01-27 08:25:35 -08:00
zoo.cfg Add ExistingDataWatch class 2021-07-02 15:22:29 -07:00
zuul-changes.py Don't fail on missing change_queues key in status json 2022-02-23 08:25:54 +01:00
zuul-clear-refs.py Zuul references cleaner 2015-07-20 18:57:04 +02:00