From: David Garcia Date: Wed, 17 Mar 2021 12:09:42 +0000 (+0100) Subject: Fix bug 1471: remove harcoded kafka host X-Git-Tag: v9.1.0^0 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FMON.git;a=commitdiff_plain;h=be46a915746ddc12a3ef484b956df79b32bf35e8 Fix bug 1471: remove harcoded kafka host Change-Id: I41c5992edb9f1c232fb7cd5d1b66153e2d403b3b Signed-off-by: David Garcia (cherry picked from commit 03afcaad2415afaa9a7794a682239a8887b6071b) --- diff --git a/osm_mon/cmd/common_functions.py b/osm_mon/cmd/common_functions.py index b85a90e..78f9242 100644 --- a/osm_mon/cmd/common_functions.py +++ b/osm_mon/cmd/common_functions.py @@ -44,7 +44,15 @@ def wait_till_core_services_are_ready(config, process_name="osm-mon", commondb_w port_in_use = False try: with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: - if s.connect_ex(("kafka", int(config.conf["message"].get("port")))) == 0: + if ( + s.connect_ex( + ( + config.conf.get("message", {}).get("host", "kafka"), + int(config.conf["message"].get("port")), + ) + ) + == 0 + ): port_in_use = True except Exception as e: logging.info("Error when trying to get kafka status.")