Fix charm status when missing amqp relation

Set charm status to blocked if not related to amqp broker

Check if context is available in NeutronAMQPContext for existing relation to a
amqp broker. Modify the context only if it already exists - pointing to charm
relation already set.

Closes-Bug: #1726419

Change-Id: I10dc05567a59bb187d537fb40628e422c77bb864
This commit is contained in:
Diko Parvanov 2019-03-25 17:41:09 +02:00
parent 3866d7bf49
commit 1ae9774e30
1 changed files with 4 additions and 0 deletions

View File

@ -851,6 +851,10 @@ class NeutronAMQPContext(context.AMQPContext):
def __call__(self):
context = super(NeutronAMQPContext, self).__call__()
# TODO (dparv) The class to be removed in next charm release
# and from BASE_RESOURCE_MAP neutron_api_utils.py as well
if not context:
return
context['notification_topics'] = ','.join(NOTIFICATION_TOPICS)
return context