bodhi: Only define consumer config for consumers.

Only hosts that have bodhi_message_routing_keys defined are
message consumers, so let's only define the fedora-messaging
consumer config settings if that variable is defined.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
This commit is contained in:
Randy Barlow 2019-05-13 20:51:04 +00:00
parent 627e815c25
commit cc0f79e999

View file

@ -9,7 +9,6 @@ topic_prefix = "org.fedoraproject.prod"
publish_exchange = "amq.topic"
passive_declares = false
callback = "bodhi.server.consumers:messaging_callback"
[tls]
@ -22,6 +21,9 @@ certfile = "/etc/fedora-messaging/bodhi-cert.pem"
app = "bodhi"
## If bodhi_message_routing_keys is defined, this must be a consumer so let's also set up the consumer
## config.
{% if bodhi_message_routing_keys %}
[queues."bodhi{{ env_suffix }}"]
durable = true
auto_delete = false
@ -38,6 +40,8 @@ routing_keys = [
{% endfor %}
]
callback = "bodhi.server.consumers:messaging_callback"
[log_config]
version = 1
@ -105,3 +109,6 @@ handlers = ["console", "email"]
[log_config.root]
level = "ERROR"
handlers = ["console", "email"]
## End consumer config if statement
{% endif %}