Skip to content
This repository has been archived by the owner on Dec 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #22 from wagmarcel/merge-from-develop-for-v1.0.4
Browse files Browse the repository at this point in the history
Merge from develop for v1.0.4
  • Loading branch information
arkocal authored Oct 5, 2018
2 parents 3b37a4a + edb17da commit 9080bcc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion deployer/src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ def wait_for_frontend():
"""Wait for OISP frontend hearbeat."""
kafka_server = os.environ["KAFKA"]
heartbeat_topic = os.environ["KAFKA_HEARTBEAT_TOPIC"]

print("Connecting to kafka at {}, topic: {} ".format(kafka_server, heartbeat_topic))
for _ in range(KAFKA_BROKER_TIMEOUT):
try:
consumer = kafka.KafkaConsumer(heartbeat_topic, bootstrap_servers=kafka_server,
auto_offset_reset='latest')
break
except kafka.errors.NoBrokersAvailable:
print("No kafka brokers available, trying again")
time.sleep(1)

print("Connected to kafka")

for message in consumer:
# Frontend heartbeat message is dashboard for historical reasons
if message.value == "dashboard":
Expand Down
2 changes: 1 addition & 1 deletion deployer/src/vcap.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __parse_dashboard_url(self, ups):
.replace("http://", "") \
.replace("https://", "") \
.replace("-", "_") \
.replace(".", "_")
.replace(".", "_").split(":")[0]

def __gather_topics_names(self, ups):
kafka_ups = self.__get_ups_by_name(ups, 'kafka-ups')
Expand Down

0 comments on commit 9080bcc

Please sign in to comment.