Skip to content

Commit

Permalink
do not add broker-link when no topic defined !
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed Mar 3, 2025
1 parent 670ca7d commit f2bb719
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions wis2box-management/wis2box/metadata/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,18 @@ def get_distribution_links(self,
}
links.append(oafeat_link)

mqp_link = {
'href': get_broker_public_endpoint(),
'type': 'application/json',
'name': topic,
'description': 'Notifications',
'rel': 'items',
'channel': topic
}
links.append(mqp_link)
if topic is None:
LOGGER.info('Do not add broker link, no topic defined')
else:
mqp_link = {
'href': get_broker_public_endpoint(),
'type': 'application/json',
'name': topic,
'description': 'Notifications',
'rel': 'items',
'channel': topic
}
links.append(mqp_link)

canonical_link = {
'href': f"{API_URL}/collections/discovery-metadata/items/{identifier}", # noqa
Expand Down

0 comments on commit f2bb719

Please sign in to comment.