Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Prevent an empty resources: list if no listener_resources defined
Browse files Browse the repository at this point in the history
This was causing worker_listener blocks to get generated with
Nonetype resources, crashing things. This was only a problem for
worker types that don't have any configured resources.
  • Loading branch information
anoadragon453 committed Jan 20, 2021
1 parent 0cca31e commit 4aae6f3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docker/conf/worker.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ worker_replication_http_port: 9093
worker_listeners:
- type: http
port: {{ port }}
{% if listener_resources %}
resources:
- names:
{%- for resource in listener_resources %}
- {{ resource }}
{%- endfor %}
{% endif %}
2 changes: 1 addition & 1 deletion docker/configure_workers_and_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def generate_worker_files(environ, config_path: str, data_dir: str):
worker_types = []
elif worker_types == "*":
# Use all known worker types
worker_types = WORKERS_CONFIG.keys()
worker_types = list(WORKERS_CONFIG.keys())
else:
# Split type names by command
worker_types = worker_types.split(",")
Expand Down

0 comments on commit 4aae6f3

Please sign in to comment.