diff --git a/deployer/src/app.py b/deployer/src/app.py index 417271c..fe9a670 100644 --- a/deployer/src/app.py +++ b/deployer/src/app.py @@ -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": diff --git a/deployer/src/vcap.py b/deployer/src/vcap.py index fc3a194..701ce45 100644 --- a/deployer/src/vcap.py +++ b/deployer/src/vcap.py @@ -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')